Thin web server: `start_tcp_server': no acceptor (RuntimeError) after git branch checkout

后端 未结 9 897
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 16:00

A Rails 3.2.0 app, working fine with Thin web server, both locally and on Heroku cedar stack.

After:

$ git branch work
$ git checkout work
$ rails se         


        
相关标签:
9条回答
  • 2020-11-29 16:19

    pgrep ruby to see what servers are running and then

    kill -9 serverNumber
    

    ;)

    0 讨论(0)
  • 2020-11-29 16:23

    I has this error because i was running rails-dev-box with Rails inside of it.

    Port 3000 in the host computer is forwarded to port 3000 in the virtual machine. 
    Thus, applications running in the virtual machine can be accessed via 
    localhost:3000 in the host computer.
    

    So is logged out from Vagrant and shutted down it:

    vagrant@rails-dev-box:/vagrant/rails$ exit
    $ vagrant halt
    

    That helped me.

    0 讨论(0)
  • 2020-11-29 16:25

    If there's any other process locking the port, you can find out which PID it has like this:

    $ lsof -i :3000
    COMMAND     PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    Passenger 40466 josh    5u  IPv4 0x7cae9332073ed4df      0t0  TCP *:hbci (LISTEN)
    Passenger 40467 josh    5u  IPv4 0x7cae9332073ed4df      0t0  TCP *:hbci (LISTEN)
    

    Then simply kill it/them:

    $ kill -9 40466
    $ kill -9 40467
    
    0 讨论(0)
提交回复
热议问题