Running on a local machine

suggest change

rails s starts the server in the default environment, which is development:

rails s

The specific environment can be selected by using the flag -e for example:

rails s -e test

Which will run the test environment.

A shell can set the environment for every command started from it:

export RAILS_ENV=production

Putting that in ~/.bashrc makes every new terminal use production, including rails db:migrate and rails console. Prefer rails s -e production for one process, or set the variable in the server environment, not in your login shell.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents