Server is already running in Rails

后端 未结 15 1210
谎友^
谎友^ 2020-12-02 04:08

When I am starting rails server using rails s command it is showing A server is already running. Check C:/Sites/folder/Pids/Server.pids

Whe

相关标签:
15条回答
  • 2020-12-02 04:51

    I just had this issue and tried setting it to a different port, but the only thing I needed to do was to delete my [app_directory]/tmp/pids/server.pid and everything was good to go.

    0 讨论(0)
  • 2020-12-02 04:52

    On Windows Rails 5.2, delete this file

    c:/Sites/<your_folder>/tmp/pids/server.pid
    

    and run

    rails s
    

    again.

    0 讨论(0)
  • 2020-12-02 04:52

    Run: fuser -k -n tcp 3000

    This will kill the process running at the default port 3000.

    0 讨论(0)
  • 2020-12-02 04:56

    Probably you suspended the server by: ^Z.

    The four digital number that vim C:/Sites/folder/Pids/Server.pidsoutputs is the process id.

    You should kill -9 processid, replacing the process id with the 4 numbers that vim (or other editor) outputed.

    0 讨论(0)
  • 2020-12-02 04:59
    lsof -wni tcp:3000
    

    Then you should see the ruby process and you can run

    kill -9 processid
    

    you should be good to run the process now

    rails s thin
    

    running multiple processes doesn't seem like a good idea and from what i've read many people agree. I've noticed many memory leaks with rails unfortunately so I couldn't imagine having two processes running. I know with one overtime my page refreshes increasingly become slower because of the data being stored on memory.

    0 讨论(0)
  • 2020-12-02 04:59
    kill -9 $(lsof -i tcp:3000 -t)
    
    0 讨论(0)
提交回复
热议问题