Skip to content

Instantly share code, notes, and snippets.

@phillipoertel
Last active December 10, 2015 08:28
Show Gist options
  • Save phillipoertel/4407848 to your computer and use it in GitHub Desktop.
Save phillipoertel/4407848 to your computer and use it in GitHub Desktop.
I've tried spring with Ruby 1.9.3/p327 (installed via rvm), running Rails 2.3.6.
* The server starts up twice (I had killed all instances before):
Maybe these are for test and dev env. But I've already seen three server.rb instances so I doubt that.
> ps aux|grep spring
phillip 17877 13,5 3,1 3164768 131244 s000 S 4:57pm 0:18.12 /Users/phillip/.rvm/rubies/ruby-1.9.3-p327-turbo/bin/ruby -r bundler/setup /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb
phillip 18036 0,0 0,0 2434892 540 s007 R+ 4:59pm 0:00.00 grep --color=auto spring
phillip 17874 0,0 1,3 2491400 55384 s000 S 4:57pm 0:00.79 /Users/phillip/.rvm/rubies/ruby-1.9.3-p327-turbo/bin/ruby -r bundler/setup /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb
* An exception is raised when doing 'spring rspec' for the first time:
> spring rspec spec/models/content_spec.rb
/Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/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/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:98:in `redirect_output'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:64:in `serve'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:53:in `block in run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:47:in `loop'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:47:in `run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application.rb:43:in `start'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:59:in `block in start_child'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `fork'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `start_child'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:17:in `start'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:36:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /Users/phillip/.rvm/rubies/ruby-1.9.3-p327-turbo/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:35:in `run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `block in boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `loop'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:9:in `boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:59:in `<main>'
* Running 'spring rspec' the second time it works, but tests fail (they don't fail when being run with plain rspec):
> spring rspec spec/models/content_spec.rb
[...]
19) Content#portfolio_item returns nil when content not in portfolio
Failure/Error: let(:image) { FactoryGirl.create(:image, user: user) }
ActiveRecord::RecordInvalid:
Gültigkeitsprüfung ist fehlgeschlagen: User ist nicht gültig
# ./spec/models/content_spec.rb:273:in `block (3 levels) in <top (required)>'
# ./spec/models/content_spec.rb:281:in `block (3 levels) in <top (required)>'
# <internal:prelude>:10:in `synchronize'
I think this has to do with complex factories and database cleaning (Database Cleaner) needing some adaptions for spring, didn't investigate further so far. These tests pass with spork and zeus, though.
* (minor) just running "spring" (as I'm used to with "spork") could output a more useful message:
> spring
/Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/commands.rb:13:in `fetch': key not found: nil (KeyError)
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/commands.rb:13:in `command'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring.rb:72:in `rails_env_for'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring.rb:44:in `run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring.rb:19:in `run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/bin/spring:5:in `<top (required)>'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/bin/spring:19:in `load'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/bin/spring:19:in `<main>'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/bin/ruby_noexec_wrapper:14:in `<main>'
* spring console outputs this:
spring console
Paperclip
You did not specify how you would like Rails to report deprecation notices for your environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/.rb
/Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
* spring rake routes gives me this:
> spring rake routes
/Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:58:in `[]=': bad environment variable value (ArgumentError)
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:58:in `block in start_child'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `fork'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:55:in `start_child'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:17:in `start'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:36:in `block in run'
from <internal:prelude>:10:in `synchronize'
from /Users/phillip/.rvm/rubies/ruby-1.9.3-p327-turbo/lib/ruby/1.9.1/mutex_m.rb:62:in `mu_synchronize'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/application_manager.rb:35:in `run'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `block in boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `loop'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:28:in `boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:9:in `boot'
from /Users/phillip/.rvm/gems/ruby-1.9.3-p327-turbo@torial/gems/spring-0.0.2/lib/spring/server.rb:59:in `<main>'
This happens even with the simplest rake task (which has no Rails dependency), so it doesn't seem to be a rake routes specific problem.
Hope this helps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment