I also used Heroku , earlier I switched to Engineyard . This is how I get ENvironemnt variables in Heroku I added a gem figaro . This pearl mainly needs the application.yml file in the app/config directory. When the Rails application is initialized, it runs and loads the key value pair set in the YAML format into memory. Heroku figaro has the ability to set the contents of application.yml .
$ figaro heroku:set -e production
However, in Engineyard we need to manually copy application.yml using the SCP option of the EY package, and the rest will be done by figaro .
First include the gem figaro in the gemfile and set the gem.
Then we need to use engineyard-hooks to copy the /data/[your_app]/shared/config/application.yml file to /data/[your_app]/current/config/application.yml . we must use before_restart hook
Commit your changes and click on your github repository or somewhere.
Here, here the /data/[your_app]/shared/config/application.yml file does not exist. Now use the following command to copy the file from the local server to the server
Now you can deploy your application and get all the environment variables.
Note. You must invoke the above command to copy the file to the server each time the environment boots. If you stop the stage (for example) and after a while load it, you need to call the command above
source share