Running on a local machine
suggest changerails 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents