Rails server start/stop

user6586190 picture user6586190 · Aug 25, 2016 · Viewed 11.7k times · Source

To run the Rails server, I use $rails server. It says 'To stop, click Ctrl+c'. I use Putty.

The questions are:

  1. Should I keep the terminal open always? Because if the server stops, my web page wouldn't work. With Apache I just used commands apachectl start/stop.

  2. What if I want to use a command? Should I stop the server, use command, and run again? Because in the same terminal I can't do enything if the server run.

Answer

kajal ojha picture kajal ojha · Aug 25, 2016

you can run it in background by writing

daemonize true

in your puma.rb file

To stop you need to find your running puma process

 ps aux | grep puma

then you need to kill the main process

 sudo kill -9 your process id

to start you need to type

 puma -C config/puma.rb