Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
443 views
in Technique[技术] by (71.8m points)

ruby on rails 3 - ROR + A server is already running. Check .../tmp/pids/server.pid. Exiting

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
=> Booting Mongrel
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
A server is already running. Check C:/Rails/tmp/pids/server.pid.Exiting

Please check the updated answer.

question from:https://stackoverflow.com/questions/15127412/ror-a-server-is-already-running-check-tmp-pids-server-pid-exiting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After googling a lot, I just delete that file and restart the server. Then again system create that file, then again I delete that file. Now Server is running fine. And System generates another copy at the same place. But it is running well.

DELETE THAT FILE ....

If you want to run two servers then it may again create trouble. So

Both commands are checking the default PID file location (tmp/pids/server.pid), so you're seeing this error. Try running multiple servers like so:

Server 1: bundle exec rails s

Server 2: bundle exec rails s -p 3001 -P tmp/pids/server2.pid

Credit: https://stackoverflow.com/a/14446920/1376448

Thanks

UPDATE after Connor Leech comment about Forman Gem

Foreman can help manage multiple processes that your Rails app depends upon when running in development. It also provides an export command to move them into production.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...