guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

guard-spork && guard-rspec fail after start #79

Closed krgn closed 12 years ago

krgn commented 12 years ago

When guard is started with

bundle exec guard start

it bails out after with error pasted below. Apparently it can't create an Adapter for some reason.

Guard is configured as follows:

guard 'spork', :wait => 60, :cucumber => false, :test_unit => false, :bundler => true, :rspec_env => { 'RAILS_ENV' => 'test' } do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/environments/.+\.rb$})
  watch(%r{^config/initializers/.+\.rb$})
  watch('Gemfile')
  watch('Gemfile.lock')
  watch('spec/spec_helper.rb') { :rspec }
end

guard 'rspec', :version => 2, :bundler => true, :cli => "--color --format nested --fail-fast --drb", :all_after_pass => false, :all_on_start => false do
  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch('spec/spec_helper.rb')  { "spec" }

  # Rails example
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  # Capybara request specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
end

The error and log output leading up to it:

Guard uses NotifySend to send notifications.
Guard is now watching at '/home/k/src/tickets'
Starting Spork for RSpec
Using RSpec, Rails
Preloading Rails environment
/home/k/.gem/ruby/1.9.1/gems/activesupport-3.0.13/lib/active_support/dependencies.rb:242:in `block in require': iconv will be deprecated in the future, use String#encode instead.
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
> /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:135:in `ensure in works?': undefined method `stop' for nil:NilClass (NoMethodError)
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:135:in `works?'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:102:in `block in usable_and_works?'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:102:in `each'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:102:in `all?'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:102:in `usable_and_works?'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/adapter.rb:36:in `select_and_initialize'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/listener.rb:185:in `initialize_adapter'
        from /home/k/.gem/ruby/1.9.1/gems/listen-0.4.2/lib/listen/listener.rb:47:in `start'
        from /home/k/.gem/ruby/1.9.1/gems/guard-1.1.1/lib/guard.rb:157:in `start'
        from /home/k/.gem/ruby/1.9.1/gems/guard-1.1.1/lib/guard/cli.rb:95:in `start'
        from /home/k/.gem/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /home/k/.gem/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /home/k/.gem/ruby/1.9.1/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
        from /home/k/.gem/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
        from /home/k/.gem/ruby/1.9.1/gems/guard-1.1.1/bin/guard:6:in `<top (required)>'
        from /home/k/.gem/ruby/1.9.1/bin/guard:23:in `load'
        from /home/k/.gem/ruby/1.9.1/bin/guard:23:in `<main>'

After it bailed out, spork process is dangling around on my system, as well.

thibaudgg commented 12 years ago

It seems to be an error with the new Listen gem integrated in Guard 1.1, could you please open an issue on that gem github issues instead. Thanks!

krgn commented 12 years ago

thanks I opened an issue there: https://github.com/guard/listen/issues/35