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

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

    Every instance of a RoR server creates a PID file. By default it is

    #{Rails.root}/tmp/pids/server.pid
    

    and if that file already exists it will refuse to start a new server.

    To run more than one server of the same project on the same machine you should manually specify the PID file name for each instance of the server (I recommend simply appending a hyphen and the port number) using the -P option:

    rails s -p 1234 -P tmp/pids/server-1234.pid
    

    I'm told in some cases you may need to supply a full (rather than relative) path, but I don't know what those cases are.

提交回复
热议问题