Reputation: 1276
recently I feel like some kind of rails process is hanging and I'm not certain what to be thinking about to debug this. if I type 'ps' and nothing is running, why is rails coughing up this error message about another instance blocking the port ?
/Users/jd/.rvm/gems/ruby-2.1.0/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/jd/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/thin-1.6.1/lib/thin/backends/tcp_server.rb:16:in `connect'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/thin-1.6.1/lib/thin/backends/base.rb:63:in `block in start'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/thin-1.6.1/lib/thin/backends/base.rb:73:in `start'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/thin-1.6.1/lib/thin/server.rb:162:in `start'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /Users/jd/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
[jd@mbp restaurantly (user-auth *)]$ ps
PID TTY TIME CMD
26212 ttys000 0:00.24 -/bin/bash
[jd@mbp restaurantly (user-auth *)]$
providing more detail, for some reason, I wasn't being allowed to kill processes ? what am I not understanding about processes ?
Upvotes: 1
Views: 283
Reputation: 8122
I guess you didn't checked the process. You should use ps -ef
or ps -aux
etc etc .. try to do this
ps -ef | grep rails | grep -v grep | awk '{print $2}' | xargs kill -9
UPDATE
Like i see in your image you are using jekyll
which rebuilds the site on changes. Most probably that things is the culprit. You can either stops jekyll
or run it without -w
command. You can also uninstall directory_watcher
if the problem isn't solved.
And, i think you can run rails in random port by doing say rails s -p 4321
.
Also, you can delete the process by adding -9
in ps
command. It is signal(KILL), generally speaking it kills the process gracefully and recursively.
Upvotes: 3