A server is already running. Check …/tmp/pids/server.pid. Exiting - rails

前端 未结 19 1443
礼貌的吻别
礼貌的吻别 2021-01-29 20:35
..$ rails s
=> Booting WEBrick
=> Rails 4.0.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=>         


        
相关标签:
19条回答
  • 2021-01-29 20:49

    the gui way for Windows user

    open the ResourceMonitor (taskmanager ->Performance -> ResourceMonitor) and kill the ruby.exe process

    0 讨论(0)
  • 2021-01-29 20:52

    Kill server.pid by using command:

    kill -9 `cat /root/myapp/tmp/pids/server.pid`
    

    Note: Use your server.pid path which display in console/terminal.

    Thank you.

    0 讨论(0)
  • 2021-01-29 20:54

    First Find PID # - where the Rails Server got stuck on

    Run this to find the stuck PID

    cat ./tmp/pids/server.pid

    It will return something like 65829

    Then KILL that PID => kill 65829

    0 讨论(0)
  • 2021-01-29 20:55

    Open the path/to/your/rails/project/tmp/pids/server.pid file.

    Copy the number you find therein.

    Run kill -9 [PID]

    Where [PID] is the number you copied from the server.pid file.

    This will kill the running server process and you can start your server again without any trouble.

    0 讨论(0)
  • 2021-01-29 20:56

    Run given below command on terminal ( for linux only )

    ps aux | grep rails
    

    and then

    kill -9 [pid]
    

    Another way

    lsof -wni tcp:3000
    

    and then

    kill -9 [PID]
    
    0 讨论(0)
  • 2021-01-29 20:58

    Short and Crisp single line command, that will take care of it.

    kill -9 $(lsof -i tcp:3000 -t)
    
    0 讨论(0)
提交回复
热议问题