rails / spring Goto Github PK
View Code? Open in Web Editor NEWRails application preloader
License: MIT License
Rails application preloader
License: MIT License
Currently, each spring server is strictly attached to the current terminal session, without caring about potential existing servers in the same project.
This means that if we open 3-4 terminal sessions in the same project and run a spring test
command in each one of them, 8 processes will be created (4 spring servers + 4 spring apps loading the test environment).
Could this be optimized?
I think that if only a server process were allowed to exist it would solve this problem. So each time a server is about to be created, it will first check if there's already a running and if not, only then create a new server, else use the existing one.
Or maybe another solution would be to check the pid files in tmp/ and use the already existing ones if there are any.
Ideally if somebody wants an rspec command, it should be in another gem, rather than in spring (either rspec
or rspec-spring
or something).
Therefore, they should be able to add something like:
require "rspec/spring"
To their config/spring.rb
However, this require activating the gem, which we don't want to do when running the spring client (because it's slow).
So we either need to stop loading config/spring.rb
when running the spring client, or figure out some other integration method.
While debugging it's pretty annoying to stop everything and get a clean slate to try again. I think it would help if we have some kind of "reset" command to shut everything down and get the project into a clean state.
Need to work with the travis peeps to get libffi on their ruby workers so that fiddle gets built when installing ruby.
Once I'm past the error described in #2 I'm stuck with:
/Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:98:in `recv_io': file descriptor was not passed (msg_controllen=0 smaller than sizeof(struct cmsghdr)=12) (SocketError)
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:98:in `redirect_output'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:64:in `serve'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:53:in `block in run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:47:in `loop'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:47:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application.rb:43:in `start'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:60:in `block in start_child'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `fork'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `start_child'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:17:in `start'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:36:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /Users/senny/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/application_manager.rb:35:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/server.rb:28:in `block in boot'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/server.rb:28:in `loop'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/server.rb:28:in `boot'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/server.rb:9:in `boot'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/server.rb:59:in `<main>'
I'm running spring inside one of our production rails apps (3.2.9) with the following command:
spring rspec spec/functional
When I tried to run the tests under spec/lib it didn't work complaining about not finding 'fiddle'. I'd create a pull-request to add the 'fiddle' dependency if that was the only problem.
But that doesn't help because fiddle seems to depend on inherited_resources although it also doesn't declare this dependency in its gemspecs...
Maybe fiddle should be fixed before fixing this gem...
/Users/jack/.rvm/gems/ruby-1.9.3-p327@app-gemset/gems/spring-0.0.2/lib/spring/application_manager.rb:58:in `[]=': bad environment variable value (ArgumentError)
Originally had it in :development group, now trying at top level in gemfile. Neither seems to work. Have you come across this yourself?
If I kill -9
the server process, the app processes should notice and kill themselves.
Example:
/home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_watcher.rb:33:in `mtime': No such file or directory - /home/turnip/Code/loco2/journeyplanner/lib/core_ext/time.rb (Errno::ENOENT)
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_watcher.rb:33:in `block in compute_mtime'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_watcher.rb:33:in `map'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_watcher.rb:33:in `compute_mtime'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_watcher.rb:27:in `stale?'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application.rb:57:in `watch_application'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application.rb:50:in `block in run'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application.rb:49:in `loop'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application.rb:49:in `run'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application.rb:45:in `start'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:67:in `block in start_child'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:63:in `fork'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:63:in `start_child'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:17:in `start'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:46:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/application_manager.rb:36:in `run'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:36:in `serve'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `block in boot'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `loop'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `boot'
from /home/turnip/.rbenv/versions/1.9.3-p194-falcon/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:9:in `boot'
from -e:1:in `<main>'
ApplicationWatcher should just tolerate ENOENT rather than exploding.
Bash has a built-in test
command, which means things can get a bit confusing:
$ spring binstub test
$ export PATH=./bin:$PATH
$ which test
./bin/test
$ test test/unit/user_test.rb # runs the bash test built-in, no output
$ bin/test test/unit/user_test.rb # runs the spring binstub
Perhaps spring testunit
would be more appropriate?
The CI is failing on Ruby 2 since 347a1b3. However, it does not fail locally on my machine using the exact same Ruby version.
@rjackson reports that 1b719bd also introduced some failures on OS X, and 347a1b3 made it worse.
See discussion: 347a1b3#commitcomment-2632201
Because zeus seems to have a problem with rspec-guard I looked into spring today tried it with
spring rspec spec
and of 550 rspec tests 55 failed... running them standalone with just plain rspec works without errors.
All the error messages look like this:
26) api/v1/images/show with image should return the image preview url for download
Failure/Error: let(:image) { FactoryGirl.build_stubbed(:image_without_file) }
ActiveRecord::AssociationTypeMismatch:
Client(#70184004674200) expected, got Client(#70184002607880)
# ./spec/views/api/v1/images/show_spec.rb:4:in `block (2 levels) in <top (required)>'
# ./spec/views/api/v1/images/show_spec.rb:8:in `block (2 levels) in <top (required)>'
# <internal:prelude>:10:in `synchronize'
# -e:1:in `<main>'
After a little searching I came across this stackoverflow articles which describes an issue which sounds very similar....
Has anybody tested the combination of spring & rspec and factorygirl?
By the way I am using Ruby 1.9.3, Rails 3.2.9 and latest rspec and factory girl...
Cheers,
Govinda
At the moment the AR database connection stays open in the application process. We should close the connection and reopen it when we fork to perform a task.
Certain users might need to run some arbitrary code after forking. (For example to reload something, or whatever.) So we should support doing this.
When I run rspec spec/failing_spec.rb ; echo $?
the exit status is 1
.
But spring always reports 0
, regardless of whether the command succeeded or failed.
When I run spring rspec spec/failing_spec.rb ; echo $?
the exit status is 0
.
Reporting the wrong exit status breaks my test-runner shell, and might impact guard etc.
We should have a seamless integration such that bin/rails console
uses spring but bin/rails server
executes as normal (without spring).
When I use this gems in a project, spring won't start (no error, just hangs).
Removing them from Gemfile and spring works normally.
Any ideas on what's going on?
Thanks!
We should explain that ruby needs to be compiled with the fiddle stdlib enabled, which required libffi to be installed on the system.
Actually I'd like to figure out if there's a way to avoid depending on fiddle, but I don't know if there is.
We have different test suites in our application. They are located in spec/unit
, spec/functional
and spec/acceptance
. Since spring tries to load spec/spec_helper
we can't run our spec suites at the moment.
I wanted to try this out on jruby (where the startup issues are even more prominent than mri) but saw that fork was used.
When running in an environment like Vagrant, the project folder is shared into the VM. This means it's not possible to create a socket file under this directory:
/var/lib/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:28:in `initialize': Operation not permitted - /vagrant/tmp/spring/2249 (Errno::EPERM)
from /var/lib/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:28:in `open'
from /var/lib/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:28:in `boot'
from /var/lib/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:9:in `boot'
from -e:1:in `<main>'
Using /tmp/spring
instead seems to work fine.
The spring
command is designed to be run outside of bundler, to keep it fast. This introduces the issue that the spring
server may be at a different version to the spring
client. So the first thing a server should do when a client connects is send its version. If the don't match, the client should exit with an error.
Currently, running top shows a spring app process consuming 10% of CPU. This is obviously unacceptable if you're going to work from a laptop.
Please, implement inotify support.
Should list installed command etc.
I'm having a hard time figuring out how to integrate this with guard. I would love to see this work with my current guard setup and would be even willing to write some code if someone gives me helpful pointers on what to do...
If I do spring rake routes | grep foo
then it works but doesn't exit properly, so I have to ^C to exit.
I just installed your gem (0.0.6) by adding it in the Gemfile, then running bundle update.
Then, I tried...
$ spring console
...but got:
/home/tom/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- fiddle (LoadError)
from /home/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
Any ideas?
I'm sure you're aware that that's a very popular Java framework, used frequently for web apps, called Spring. In case this was an oversight, you may want to consider renaming. Certainly name clashes happen across communities all the time, but given the domain overlap, the SEO for this is likely to be really wonky.
This seemed like a nice idea at the time but it means we're watching lots more files than just those under the app root, so using more CPU and I think it's simpler to just say "spring will only notice changes under your app root". If you change e.g. a gem which resides on the filesystem then you'll need to stop spring to notice the changes.
Hi,
Hitting ctrl+c during a rspec command don't kill the process.
I'm back to the bash but the command is still running and outputting (like when we call ctrl+z and bg on bash).
Would like to do spring g migration AddFooToBar
Currently throws a couple errors:
/Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/commands.rb:13:in `fetch': key not found: "g" (KeyError)
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/commands.rb:13:in `command'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring.rb:97:in `rails_env_for'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring.rb:60:in `run'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring.rb:21:in `run'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/bin/spring:5:in `<top (required)>'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/bin/spring:23:in `load'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/bin/spring:23:in `<main>'
/Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:34:in `serve': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `block in boot'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `loop'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:29:in `boot'
from /Users/turadg/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/spring-0.0.4/lib/spring/server.rb:9:in `boot'
from -e:1:in `<main>'
The latest published version is not working:
λ spring rspec spec/integrations/models/fiscal_shift_spec.rb
-e:in `require': cannot load such file -- spring/server (LoadError)
λ spring console
-e:in `require': cannot load such file -- spring/server (LoadError)
Using bundler:
λ bundle exec spring console
/Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:98:in `recv_io': file descriptor was not passed (msg_controllen=0 smaller than sizeof(struct cmsghdr)=12) (SocketError)
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:98:in `redirect_output'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:64:in `serve'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:53:in `block in run'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:47:in `loop'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:47:in `run'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application.rb:43:in `start'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:59:in `block in start_child'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `fork'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `start_child'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:17:in `start'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:36:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /Users/sobrinho/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/application_manager.rb:35:in `run'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/server.rb:28:in `block in boot'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/server.rb:28:in `loop'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/server.rb:28:in `boot'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/server.rb:9:in `boot'
from /Users/sobrinho/Developer/.../vendor/bundle/ruby/1.9.1/gems/spring-0.0.2/lib/spring/server.rb:59:in `<main>'
I don't care about bundler, makes more sense to use spring without it.
Let's focus on require issue :)
It's said that the app's processes will only exit when the terminal is closed, but devs are quite often used to just cd
out of a project and work on another. This need to be handled somehow or you'll need to open another shell (and lose more time there, the pwd
, etc).
I have been playing with the idea of JRuby support for a few days now, and figured that I would see if you would be interested before I put too much work into it.
I have been using drip under JRuby for a little while to help speedup the general process launch case, but I would love to get something working directly with spring.
The only real issue with the current code base (that I can see) under JRuby is the usage of Kernel.fork
and Process.spawn
. Obviously, running under the JVM fork isn't available.
The easiest (still not simple) solution that I can see is to use the api provided by childprocess and refactor the code where fork and spawn are called to allow them to be called directly from the command line.
It would still use fork under *nix, but under JRuby it would use java.lang.ProcessBuilder
to build up a process. Alternatively, we could set childprocess to use posix_spawn mode so that both are on equal footing.
When I run spring console
I don't see the characters I type. I can still execute the entered command and it will print the response but I don't see anything while typing.
Am I missing something, or is there currently no way to replace rails s
with spring ___
?
We need to not depend on AS, as that will mess with the fast gem activation done in binstubs.
I'm confused by the suggested use of binstubs
.
We use bundle install --binstubs
on all of our projects, which creates stubs such as bin/rails
, bin/rspec
, etc.
But the instructions imply that I should also run spin binstub rspec
in order to overwrite the bin/rspec
stub with one that uses spin. This feels like a world of pain as bundler and spin continually overwrite each other's binstubs. It's also not clear if spin will precede rspec
with bundle exec
, since bundler's bin/rspec
stub is no longer there.
So how are we supposed to use both bunder and spin binstubs?
When I use Spring to run a spec that calls Timecop, Rspec's time estimate is way high.
$ time spring rspec spec/models/quiz_spec.rb
.........................................
Finished in 48 minutes 10.14 seconds
41 examples, 0 failures
real 0m11.434s
user 0m0.266s
sys 0m0.054s
That spec has these lines:
time_now = Time.now()
time_future = time_now + 16*60 #moving 16 minutes forward (in seconds)
Timecop.travel(time_future)
Note that Timecop.travel() doesn't execute a block. So it advances time 16 minutes and that must happen three times to account for the 48 minutes. I thought maybe I was using it wrong, but running this spec without Spring works fine:
$ time rspec spec/models/quiz_spec.rb
Rack::File headers parameter replaces cache_control after Rack 1.5.
.........................................
Finished in 8.88 seconds
41 examples, 0 failures
real 0m15.876s
user 0m11.543s
sys 0m1.708s
Is this a bug or by design?
Engines have a different directory structure than rails apps. Spring wants to load config/application.rb
to boot up the application. Inside an engine we need to load the dummy application. Otherwise we get:
/Users/senny/Projects/spring/lib/spring/application.rb:30:in `require': cannot load such file -- ./config/application (LoadError)
from /Users/senny/Projects/spring/lib/spring/application.rb:30:in `start'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:67:in `block in start_child'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:63:in `fork'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:63:in `start_child'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:17:in `start'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:46:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /Users/senny/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /Users/senny/Projects/spring/lib/spring/application_manager.rb:36:in `run'
from /Users/senny/Projects/spring/lib/spring/server.rb:37:in `serve'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `block in boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `loop'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:9:in `boot'
from -e:1:in `<main>'
/Users/senny/Projects/spring/lib/spring/application_manager.rb:51:in `run': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/senny/Projects/spring/lib/spring/server.rb:37:in `serve'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `block in boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `loop'
from /Users/senny/Projects/spring/lib/spring/server.rb:29:in `boot'
from /Users/senny/Projects/spring/lib/spring/server.rb:9:in `boot'
from -e:1:in `<main>'
/Users/senny/Projects/spring/lib/spring.rb:102:in `run_command': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/senny/Projects/spring/lib/spring.rb:56:in `run'
from /Users/senny/Projects/spring/lib/spring.rb:22:in `run'
from /Users/senny/Projects/spring/bin/spring:5:in `<top (required)>'
from bin/spring:16:in `load'
from bin/spring:16:in `<main>'
If a process crashes and does not clean up the associated PID file spring won't work until the PID file is removed. The error I get is:
/Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:66:in `ensure in run': undefined method `close' for nil:NilClass (NoMethodError)
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:66:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:19:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/bin/spring:5:in `<top (required)>'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `load'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `<main>'
Would it be reasonable to unlink the PID file if the returned socket is nil and re-run the process? Let me know and I'll submit a PR.
When no command is supplied spring crashes with:
/Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/commands.rb:13:in `fetch': key not found: nil (KeyError)
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring/commands.rb:13:in `command'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:72:in `rails_env_for'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:44:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:19:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/bin/spring:5:in `<top (required)>'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `load'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `<main>'
I know this is mostly a proof of concept and not refined. I just think I'll log every exception in an issue so you can decide which ones have priority.
Any examples of support for cucumber?
Thx
When calling spring outside the RAILS_ROOT directory I get the following error:
/Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:66:in `ensure in run': undefined method `close' for nil:NilClass (NoMethodError)
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:66:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/lib/spring.rb:19:in `run'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/gems/spring-0.0.2/bin/spring:5:in `<top (required)>'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `load'
from /Users/senny/.rvm/gems/ruby-1.9.3-p194@equis/bin/spring:19:in `<main>'
This happens for subdirectories of your rails application as well as directories outside a rails app.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.