The following command could start the Rails daemon server for you Rails web application.
- rails s
Stopping the web server could be done by simply enter the Ctrl + C command in the terminal. But if your terminal session is disconnected, you have no way to stop the service. In that case, you have to kill the process directly.
First, find out the process ID of the Rails web server.
- ps -ef | grep script/rails
Kill the process directly
- kill -9 <Process ID>
Actually i wonder if there is a better way to stop the Rails web server. If you know it, please let me know. =P
Done =)
Reference: How to stop the server in Rails
Update @ 2013-05-23: varmaavinash01 made a bash function for stopping the Rails Web Server. Thanks. =)
kill -9 `pgrep ruby`
LikeLike
Thanks Fernando, that works too but it will kill all running ruby programs too, right?
LikeLike
To kill rails server I made a bash function :
LikeLike
Thanks for sharing. =D
LikeLike
Thanks 4 sharing
LikeLike
you are welcome~ thanks for your comment. =)
LikeLike
This is great. Thanks for helping.
LikeLike