Ruby on Rails : Forman : Passing Environment variables and secrets

With foreman you can use .env files to declare the environment variables for your app (and it’s dependencies) and maintain them isolated from the rest of your environment. So, if you’re using theaws-sdk gem, your .env file would look like:


And foreman automatically loads the .env file that is at the same directory as your Procfile.

This way you can make all environment specific configuration for your app to live at this .env file and let every developer set their own specific configurations here. All variables declared here will be available for all processes started by foreman as environment variables.

Continue reading