Heroku config:push not updating environment variables
Asked Answered
C

1

7

I've deployed an app to Heroku, and I'm currently storing my environment variables in an .env file. I used heroku config:push to push the variables up to heroku, and that worked fine.

Now, I want to update one of them. I changed it in my .env file, and ran heroku config:push again. The push said it was successful, but when I run heroku config, I can see that the values actually haven't changed. I've tried running heroku restart, but that didn't do anything.

How can I update my environment variables in heroku?

Coachwork answered 24/12, 2012 at 2:1 Comment(0)
C
17

Figured it out. You need to run heroku config:push --overwrite because it won't overwrite existing variables by default. This is poorly documented :-/

Coachwork answered 24/12, 2012 at 2:13 Comment(5)
+1 for poor documentation by heroku. devcenter.heroku.com/articles/config-vars#local-setup clearly states that you need to use --overwrite when pulling variables but not when pushing.Iodate
heroku config:push --overwrite doesn't seem to be working for me. It still shows the older configuration when I do heroku configJoscelin
It worked for me. But I noticed problems with spaces or quotes in the definition of my variables in .env. It seems you should not use any spaces or quotes, which makes it very hard to readPlatinumblond
@Platinumblond I also found out single quotes are different than double quotes.Longeron
is this still true today ?Weintraub

© 2022 - 2024 — McMap. All rights reserved.