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

后端 未结 14 1934
渐次进展
渐次进展 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:37

    I deleted the file with cd'ing in to the tmp directory then removing the file

    rm server.pid
    

    Then I restarted the server and I got this error

    Exiting/Users/josephmellin/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/socket.rb:206:in `bind': Address already in use - bind(2) for 0.0.0.0:3000 (Errno::EADDRINUSE)
    

    Then I could use the following command to see which process is running.

    sudo lsof -iTCP -sTCP:LISTEN -P | grep :3000
    

    And after I entered my password, I got this resoponse

    ruby      2786 josephmellin   12u  IPv4 0xfeadd8ae849eaec9      0t0  TCP *:3000 (LISTEN)
    

    And then killed the process with the following command

    KILL -9 2786
    

    And then restarted the server (you will have a different number than 2786 - I left it here for demo purposes)

提交回复
热议问题