Skip to content

Instantly share code, notes, and snippets.

@danielpuglisi
Last active December 21, 2015 04:18
Show Gist options
  • Save danielpuglisi/56d4d3c7e2b90257799d to your computer and use it in GitHub Desktop.
Save danielpuglisi/56d4d3c7e2b90257799d to your computer and use it in GitHub Desktop.
Rails ENV variables: heroku development setup
# other stuff
config/env.rb
# other stuff
username = ENV["USERNAME"]
password = ENV["PASSWORD"]
ENV["USERNAME"] = "peter"
ENV["PASSWORD"] = "enis"
# Load the rails application
require File.expand_path('../application', __FILE__)
# Load heroku vars from local file
heroku_env = File.join(Rails.root, 'config', 'env.rb')
load(heroku_env) if File.exists?(heroku_env)
# Initialize the rails application
YourAppName::Application.initialize!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment