ROR + A server is already running. Check …/tmp/pids/server.pid. Exiting

后端 未结 14 1898
渐次进展
渐次进展 2020-12-22 23:55

In my Rails Project, I am trying to run two different servers at different port. But it fails by giving this error at console.

C:\\Rails>rails s
=> Boo         


        
14条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-23 00:25

    Step 1: remove .pid

    C:/Rails/tmp/pids/server.pid.Exiting
    
    # IN linux/unix shell
    $ rm -rf 
    

    Sometime this doesn't solve the problem, then you have to kill the process running by localhost, for such cases, follow STEP 2

    STEP 2: List the process for localhost and kill it

    # For Linux/Unix shell
    
    $ lsof -wni tcp:3000
    
    # output
    COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    ruby    5946 rails   11u  IPv4  79073      0t0  TCP *:3000 (LISTEN)
    ruby    5946 rails   12u  IPv4 103786      0t0  TCP 127.0.0.1:3000->127.0.0.1:53612 (ESTABLISHED)
    
    # Kill the running process
    $ kill -9 5946
    

    run your server again

    rails server
    

提交回复
热议问题