Skip to content

Instantly share code, notes, and snippets.

@jmadden
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmadden/b9d5c18c05b73e09f46e to your computer and use it in GitHub Desktop.
Save jmadden/b9d5c18c05b73e09f46e to your computer and use it in GitHub Desktop.
#Heroku Notes – Configurations and commands through the Heroku Toolbelt

#Heroku Notes ######Configurations and commands through the Heroku Toolbelt

Setting Environment Variables

Variables can be set and accessed on Heroku Dynos. To review your Dyno's configuration type the following in your toolbelt.

$ heroku config

Folloing is an example of how your results may look:

=== my-dyno Config Vars
S3_BUCKET_NAME:               <your_bucket_name>
AWS_ACCESS_KEY_ID:            <your_access_key_id>
AWS_SECRET_ACCESS_KEY:        <your_secret_access_key>
DATABASE_URL:                 <your_database_url>
HEROKU_POSTGRESQL_PURPLE_URL: <your_database_url>
LANG:                         en_US.UTF-8
RACK_ENV:                     production
RAILS_ENV:                    production
TZ:                           America/New_York

###Creating a Heroku Envornment Variable Let's say you would like to create an enviornmet varialbe for an S3 bucket. You would write the folling:

$ heorku config:set S3_BUCKET_NAME=your-bucket-name

###Updating/Changing a Heroku Environment Variable This is actually the same as creating a new environment variable.

$ heorku config:set S3_BUCKET_NAME=updated-bucket-name

###Deleting a Heroku Environment Variable Lets say I'm no longer using S3. I could delete the S3 bucket variable by doing the following:

$ heroku config:unset S3_BUCKET_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment