Eventmachine start_tcp_server没有接受者 - 端口正在使用或需要root权限(RuntimeError)

时间:2015-05-29 01:48:05

标签: ruby-on-rails git ruby-on-rails-4 localhost eventmachine

我现在无法运行本地服务器3天了。重新启动计算机没有帮助。有几次,经过反复尝试大约40-50次,它随机工作 - 我无法弄清楚为什么。我尝试过一次不同的端口,但是从那时起,没有端口工作。每次我尝试运行我的rails服务器时都会得到这个。

/Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:526:in `start_server'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/thin-1.5.1/lib/thin/backends/tcp_server.rb:16:in `connect'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/thin-1.5.1/lib/thin/backends/base.rb:55:in `block in start'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:187:in `call'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:187:in `run_machine'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:187:in `run'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/thin-1.5.1/lib/thin/server.rb:159:in `start'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/rack-1.6.1/lib/rack/handler/thin.rb:19:in `run'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/rack-1.6.1/lib/rack/server.rb:286:in `start'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

当我运行ps aux | grep rails时,我得到了这个输出:

colmtuite        6422   0.0  0.0  2441988    668 s002  S+    2:44am   0:00.00 grep rails

当我运行ps aux | grep ruby时,我得到了这个输出:

colmtuite       13305   0.0  0.0  2423356    200 s000  R+    8:15pm   0:00.00 grep ruby

我的港口出于某种原因关闭了吗?

1 个答案:

答案 0 :(得分:11)

我也有同样的问题

这对我有用

$ ps ax | grep rails

然后使用进程ID

终止进程
$ kill -9 [process Id]

..

实施例

$ kill -9 20496

...

再次启动服务器