5

Every time when I run 2 rails server on different port say 3000 and 3001.

After starting server on port 3000

Rails$ rails s -p 3000 
=> 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

when I run second rails server on port 3001,

Rails$ rails s -p 3001
=> Booting Mongrel
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
A server is already running. Check /Rails/tmp/pids/server.pid.
Exiting

I need to delete server.pid file, before I am able to start rails server on port 3001. Is there any way to avoid this deletion of file every time?

olucube.com
  • 330
  • 2
  • 11
Ashwini
  • 2,449
  • 2
  • 29
  • 42

1 Answers1

16

Start your consecutive applications like:

rails s -p 3001 -P tmp/pids/server_2.pid

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

Community
  • 1
  • 1
kiddorails
  • 12,961
  • 2
  • 32
  • 41