How to start Rails server with environment variables set?
Bundle the dotenv-rails gem, then create a .env
file with the content:
VARIABLE=development
The gem picks up all variables from the file and sets them in your environment.
You have various options to do so:
Declare your variables in
.bashrc
file and reload it.Use
dotenv
gem.Use
figaro
gem.
More info @ http://www.gotealeaf.com/blog/managing-environment-configuration-variables-in-rails