Skip to content

Instantly share code, notes, and snippets.

@danielpuglisi
Last active Dec 21, 2015
Embed
What would you like to do?
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