Will Sewell Will Sewell - 3 years ago 242
Ruby Question

EventMachine: "`start_tcp_server': no acceptor (port is in use or requires root privileges)"

When I try and run the server with

I keep getting the error saying that the port is in use. This started ever since I ran the server in the background with the command

I am pretty sure I have killed the process I started.

  • I found the ruby process with
    , and killed it. It no longer shows up.

  • I also ran
    lsof -i :8081
    (8081 is the port I ran it on) and nothing shows up.

  • Finally, I have changed the port in the ruby program a number of times to obscure ports, and still get the error!

I also though it could be the lack of me being the root user, so tried it as root to no avail.

I have also restarted the server.

Please let me know if there's anything else I can try.

Note: this is on debian.

Answer Source

I have finally figured it out: it was actually the IP address I was binding to that was incorrect!

So essentially it is a very misleading error message, and if you get it, check the IP address too.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download