1

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 ?

enter image description here

John
  • 1,246
  • 15
  • 34

1 Answers1

3

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.

Paritosh Piplewar
  • 7,982
  • 5
  • 26
  • 41
  • To elaborate a bit; `ps` on its own only reports processes where *you're* the owner. If the system, or some other user, is the owner, then `ps` won't report it. That's why the `-ef` was added above. See `man ps` for more information. – Bob Gilmore Mar 02 '14 at 05:25
  • that doesn't really answer the question though. of course, it is helpful to have a better ps command, but it doesn't tell me much about why my system seems to think there was a random ruby process running. – John Mar 02 '14 at 20:14
  • @John when you kill the process, are you still facing this problem ? – Paritosh Piplewar Mar 02 '14 at 20:15
  • in the original post, I had restarted my system, so I was kind of under the impression that there weren't any processes running, at one point, no matter the port I specified, i got the above error, which was really strange. – John Mar 02 '14 at 21:30
  • @ParitoshPiplewar can you look at the image I posted above, is there anything that helps you understand my problems ? the xargs kill -9 was def useful. why am I finding myself in a situation where I need it ? – John Mar 03 '14 at 00:09