Heroku配置:推送不更新环境变量

时间:2021-08-23 23:14:52

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.

我已经向Heroku部署了一个应用程序,我目前正将环境变量存储在.env文件中。我使用了heroku配置:push将变量推送到heroku,并且工作正常。

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.

现在,我想更新其中一个。我在.env文件中更改了它,并运行了heroku配置:再次按下。推送说它很成功,但是当我运行heroku配置时,我可以看到值实际上没有改变。我已经尝试运行heroku重启,但这没有做任何事情。

How can I update my environment variables in heroku?

如何更新heroku中的环境变量?

1 个解决方案

#1


13  

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

弄清楚了。您需要运行heroku config:push --overwrite,因为默认情况下它不会覆盖现有变量。这个记录很少: - /

#1


13  

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

弄清楚了。您需要运行heroku config:push --overwrite,因为默认情况下它不会覆盖现有变量。这个记录很少: - /

相关文章