/Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError)

Seeing this error when trying to run your Rack or Sinatra webapp?

It’s probably because you’re already running something on the port you’re trying to use. This happens quite a bit if you’re using daemonized Rack apps that go off on their own after you close the controlling shell.

Use this command to see what’s happening on a port:

$ lsof -i :4567
COMMAND   PID     USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
ruby    74716 mathiasx    5u  IPv4 0x073562a4      0t0  TCP *:tram (LISTEN)

It’ll help you see the PID of the process that’s hogging that port. Just be careful not to kill anything that should be on that port!