Pusher-Fake + Cucumber + Rails:错误“无接受者”

时间:2014-06-06 21:44:41

标签: ruby-on-rails cucumber pusher

这里是完整的错误堆栈跟踪:

/Users/me/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/thin-1.6.1/lib/thin/backends/tcp_server.rb:16:in `connect'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/thin-1.6.1/lib/thin/backends/base.rb:63:in `block in start'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/thin-1.6.1/lib/thin/backends/base.rb:70:in `call'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/thin-1.6.1/lib/thin/backends/base.rb:70:in `start'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/thin-1.6.1/lib/thin/server.rb:162:in `start'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/server.rb:43:in `block in start_web_server'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/server.rb:38:in `tap' 
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/server.rb:38:in `start_web_server'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/server.rb:11:in `block in start'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run' 
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/server.rb:10:in `start'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/cucumber.rb:15:in `block in <top (required)>'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/cucumber.rb:15:in `fork'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/pusher-fake-0.14.0/lib/pusher-fake/cucumber.rb:15:in `<top (required)>'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
  from /Users/me/ecosystems/staging/rails_project/features/support/env.rb:10:in `<top (required)>'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/rb_support/rb_language.rb:122:in `load'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/rb_support/rb_language.rb:122:in `load_code_file'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime/support_code.rb:180:in `load_file'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime/support_code.rb:82:in `each'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime.rb:184:in `load_step_definitions'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/runtime.rb:42:in `run!'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/lib/cucumber/cli/main.rb:47:in `execute!'
  from /Users/me/.rvm/gems/ruby-2.1.1/gems/cucumber-1.3.11/bin/cucumber:13:in `<top (required)>'
  from /Users/me/.rvm/gems/ruby-2.1.1/bin/cucumber:23:in `load'
  from /Users/me/.rvm/gems/ruby-2.1.1/bin/cucumber:23:in `<main>'
  from /Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
  from /Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

features/support/env.rb:11是:

require "pusher-fake/cucumber"

config/initializer/pusher.rb

PusherFake.configuration.socket_options = { host: "127.0.0.1", port: 8088 } if Rails.env.test?

但是,当我在debuggerrequire前面贴上lsof -i时,8088端口没有任何内容。我很难过,任何想法?

1 个答案:

答案 0 :(得分:1)

$> pgrep ruby
$> kill -9 "PORT"

如果pgrep ruby吐出:

7637
8097

您输入以下命令:

$> kill -9 7637
$> kill -9 8097