Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: How to start rails server in background

When I run ruby script/server -e test, it runs on console. When I close the console, it also stops the process. I want to run the server in the background. How can I do this?

like image 335
Usman Ali Avatar asked Dec 02 '10 11:12

Usman Ali


People also ask

Which is the command to start the server in Rails?

Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option.

What happens when we start rails server?

One of the things rails server does is that it loads all the dependencies/gems required by your Rails app, or at least sets them up to be auto-loaded later when they are needed. This is sometimes called "booting" or loading the "Rails environment".


1 Answers

You can run it as a daemon with script/server -d

like image 63
vise Avatar answered Oct 26 '22 06:10

vise