Sam Kong
Sam Kong

Reputation: 5810

gitignored file to Heroku

I am a rails developer and trying to get familiar with Heroku.

I don't add config/environment.rb to git as environment.rb might be different for each environment. For example, ENV['RAILS_ENV'] = 'some_env' should be in environment.rb.

However, Heroku requires environment.rb to be in git so that I can push it to Heroku.

Is there a way to just copy environment.rb to Heroku without version-controlling it?

Thanks.

Sam

Upvotes: 1

Views: 68

Answers (1)

Schneems
Schneems

Reputation: 15828

You always want to keep the environment.rb file checked in. You can set the environment using config variables

heroku config:add RAILS_ENV=some_env

So you store your config with each individual app. You can read any config variables from your application by using ENV[]

Upvotes: 3

Related Questions