Eventmachine start_tcp_server no acceptor-port is in use or requires root privileges (RuntimeError)
I was unable to start my local server for 3 days. Restarting my computer doesn't help. A couple of times, after repetitively about 40-50 times, it worked randomly - I can't figure out why. I tried another port once and it worked, but the port hasn't worked since then. Every time I try to start my rails server I get this.
/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>'
When I run ps aux | grep rails
I get this output:
colmtuite 6422 0.0 0.0 2441988 668 s002 S+ 2:44am 0:00.00 grep rails
When I run ps aux | grep ruby
I get this output:
colmtuite 13305 0.0 0.0 2423356 200 s000 R+ 8:15pm 0:00.00 grep ruby
Are my ports closed for some reason?
source to share
/usr/local/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:in start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError) from/usr/local/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:in
start_server 'from /usr/local/lib/ruby/gems/2.2.0/ gems / thin-1.6.4 / lib / thin / backends / tcp_server.rb: 16: in connect' from/usr/local/lib/ruby/gems/2.2.0/gems/thin-1.6.4/lib/thin/backends/base.rb:63:in
block at startup 'from /usr/local/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.7/lib /eventmachine.rb:195:in call' from/usr/local/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in
run_machine 'from /usr/local/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in run' from/usr/local/lib/ruby/gems/2.2.0/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in
beginning' from / usr / local /lib/ruby/gems/2.2.0/gems/thin-1.6.4/lib/thin/server.rb:162:in start' from/usr/local/lib/ruby/gems/2.2.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in
start' from/usr/local/lib/ruby/gems/2.2.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in
'from / bin / zdnsloader: 23: block in run_service' from/bin/zdnsloader:5:in
forked' from / bin / zdnsloader: 5 : in run_service' from/bin/zdnsloader:37:in
'
进程 : 查找 监听 端口 s lsof -i: 80 COMMAND PID USER FID TYPE DEVICE SIZE FD SIZE / DISABLE NODE NAME zdnsloade 17899 root 29u IPv6 102948344 0t64 TCP local host: 48394-> localOSE 176 zwtc64 localhost (localhost): 48394-> localhost6 0 zwtcA TCP : 51016-> localhost: kwtc (CLOSE_WAIT) zdnsloade 28185 root 12u IPv6 102962591 0t64 TCP *: kwtc (LISTEN)
kill -9 28185 kill -9 17899
source to share