heroku config:推送不添加环境variables

您好,我已经从heroku教程做了以下。

heroku plugins:install git://github.com/ddollar/heroku-config.git heroku config:push --overwrite 

我的.env文件是在项目目录的根目录

 GOOGLE_RETURN_URL = http://example.herokuapp.com/auth/google/return GOOGLE_REALM = http://example.herokuapp.com/ 

我也设置了–overwrite标志,因为这个答案build议

但是当我回应我的heroku config它仍然是空的!

问题是您的.env文件中的空格。 删除“=”两边的空格,插件将工作。

更改:

 GOOGLE_RETURN_URL = http://example.herokuapp.com/auth/google/return GOOGLE_REALM = http://example.herokuapp.com/ 

至:

 GOOGLE_RETURN_URL=http://example.herokuapp.com/auth/google/return GOOGLE_REALM=http://example.herokuapp.com/