config icon indicating copy to clipboard operation
config copied to clipboard

Heroku Compatibility

Open jamesy829 opened this issue 9 years ago • 5 comments

I use the suggested guide to setup usage of env variables on Heroku

https://github.com/railsconfig/rails_config#working-with-heroku

I have my env variables on Heroku as following:

Settings.database.dbname: value
Settings.keys.aws_access_key_id: value
Settings.keys.aws_secret_access_key: value
Settings.keys.devise_secret_key: value
Settings.keys.directory: value
Settings.keys.region: value
Settings.keys.secret_key_base: value

I noticed that when it tries to run rake task, it would complain env variables not found, and doing some digging, I discovered those are not valid env variables and Rails would not pick them up properly.

I have pushed those env variables using the rake task provided bundle exec rake rails_config:heroku

Is this a valid bug or the expected behaviour? If its not a bug, what's the approach I should be taking.

Thanks in advance.

jamesy829 avatar Jul 30 '14 14:07 jamesy829

Found a possible work around

https://github.com/finnlabs/rails_config-env_source

Giving it a shot and if works, submit a PR to merge

jamesy829 avatar Jul 30 '14 18:07 jamesy829

I have confirmed using this and the specified format of environment variables will allow the deployment to Heroku work properly, would be nice to have this as part of this gem

jamesy829 avatar Jul 31 '14 13:07 jamesy829

Great work! Any chance of submitting a PR? :)

fredwu avatar Aug 06 '15 04:08 fredwu

@cjlarose do you think it makes sense to add any of this to our source code?

pkuczynski avatar Dec 09 '20 14:12 pkuczynski

I'll take a look. It's an old issue, so this might already be fixed, but we can at least improve our docs with recommendations.

cjlarose avatar Dec 09 '20 21:12 cjlarose