Heroku using production configuration instead of staging configuration
Asked Answered
U

2

6

I'm running two apps on Heroku, one being myapp-production and the other one being myapp-staging.

For some reason however, the staging app uses the production environment configuration rather than the staging configuration, which I have defined in staging.rb.

The way I set up the staging app was by running

heroku create --stack cedar --remote staging

and afterwards

heroku config:add RACK_ENV=staging --app myapp-staging

Yet myapp-staging is still using the production configuration. Any ideas why and how to address that?

Ustkamenogorsk answered 6/5, 2012 at 19:18 Comment(0)
C
9

It's important to add RAILS_ENV=staging too

heroku config:add RAILS_ENV=staging --app myapp-staging
Carbamidine answered 6/5, 2012 at 19:31 Comment(1)
sadly, Heroku's devcenter.heroku.com/articles/cedar-migration (as of today 2/21/2013) doesn't mention RAILS_ENV at all. I figured it out like you did, and it worked.Denyse
G
0

Did you restart your dynos (heroku restart) after making this change to your configuration?

Grenadines answered 6/5, 2012 at 19:25 Comment(2)
adding config variables automatically restarts the application.Carbamidine
Ack! Of course. I was just about to add the same message as @JohnBeynon - just tested that on an app and can confirm that it works as expected.Grenadines

© 2022 - 2024 — McMap. All rights reserved.