Heroku config:不更新环境变量 [英] Heroku config:push not updating environment variables
问题描述
我已经将一个应用程序部署到Heroku,我正在将我的环境变量存储在.env文件中。我使用 heroku config:push
将变量推送到heroku,并且工作正常。
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.
现在,我想要更新其中之一。我更改了.env文件,并再次运行 heroku config:push
。推动它是成功的,但是当我运行 heroku config
时,我可以看到这些值实际上没有改变。我尝试运行 heroku restart
,但没有做任何事情。
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.
如何更新我的环境变量在heroku?
How can I update my environment variables in heroku?
推荐答案
您需要运行 heroku config:push --overwrite
,因为它不会默认覆盖现有变量。这个说法很差: - /
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:不更新环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!