Environment Variables

There are a few ways to add environment variables to your Rails application. On Engine Yard Cloud, the easiest way is through the Environment Variables link on the environment page as shown below.

environment_variable_link.png
This Environment Variables feature is in Early Access. If you want to use it, click Tools > Early Access. Search for "Environment variables" and click Enable.early_access_environment_variables.png

This feature currently only works with the stable-v5 stack. You also need a recent version of the stack. Click Upgrade if you see the button for your environment.

Back to the environments page, click Environment Variables, then click New Variable. Enter the Name and Value. Check the Sensitive box if you're adding a credential.

create_environment_variable.png

After adding environment variables, click Apply or Upgrade (if you haven't upgraded yet).

When all instances are green, you need to restart your Rails application for the environment variables to take effect. You can deploy your application using the Deploy button or the engineyard gem.

How does this work?

When you click Apply or Upgrade, our Chef recipes will create env.cloud located in /data/APPNAME/shared/config. This file is used on the unicorn and passenger scripts.

Comments

0 comments

Article is closed for comments.