8

While trying to run my config.ru, I'm getting an odd error I can't seem to debug called a 'No acceptor' error.

Full error message:

eventmachine.rb:572:in `start_tcp_server': no acceptor (RuntimeError)

Does anyone know what this error means? Thanks.

Telemachus
  • 19,459
  • 7
  • 57
  • 79
beakr
  • 5,709
  • 11
  • 42
  • 66

3 Answers3

12

As @Fivell says, I think the problem is that you have a previous instance of thin still running. Rather than start on another port though, I would recommend killing the previous instance. Something like this should do the job (I recreated the problem here, so this is real output on my end):

telemachus caps $ ps ax | grep ruby
  153   ??  S      7:52.18 ruby /usr/local/bin/djsd
15801   ??  S      0:00.40 ruby caps.rb  # this is our problem, get it's PID
15973 s000  S+     0:00.00 grep ruby

telemachus caps $ kill -9 15801 # thin needs -9 - hard to kill
telemachus caps $ ps ax | grep ruby
  153   ??  R      7:52.86 ruby /usr/local/bin/djsd
16057 s000  S+     0:00.00 grep ruby

Depending on how you started your app, you may need to grep for something different (say if you used shotgun or rackup).

Telemachus
  • 19,459
  • 7
  • 57
  • 79
1

I think the problem is that using port is already binded (maybe you started your application earlier) Try to change port

rackup config.ru -p port    #default port is 9292 change to something else

or if you use thin

thin start  -p port -a 0.0.0.0  -R config.ru #default port is 8080 change to something else
Telemachus
  • 19,459
  • 7
  • 57
  • 79
Fivell
  • 11,829
  • 3
  • 61
  • 99
  • I've seen this exact problem a number of times when people simply shut a terminal window instead of using `CTRL-C` to kill a running thin server. If you close the window, the process seems to go zombie. – Telemachus Apr 29 '12 at 13:23
  • I personally did it few days ago =) – Fivell Apr 29 '12 at 13:24
0

I am getting this error although there are no zombie processes and the port is not binded.

This works:

thin -p9292 start

But this does not:

rackup
Tim Inman
  • 61
  • 5