如何为heroku应用程序更改DATABASE_URL [英] How to change DATABASE_URL for a heroku application
问题描述
我准备好了一个外部数据库,现在想用我的heroku应用程序来使用该数据库。但我无法编辑配置变量。我尝试使用GUI,它说,无法覆盖附件值DATABASE_URL。虽然我也尝试使用CLI。我使用了以下命令:heroku config:addDATABASE_URL =postgresql:// username:password @ IP:PORT。然而,这会引发错误........不是一个heroku命令。
解决了它。仅供具有相同问题或希望具有类似实现的用户参考。这是我工作的解决方法。
Heroku不会覆盖databse.yml,所以我只是修改database.yml中的DATBASE_URL并将其推入:)
它也起作用了!
来源: https://discussion.heroku.com/t/rails-4-1-database-yml- no-longer-overwrite-on-heroku / 550
I've an external database ready and want to now use that database with my heroku app. But I'm unable to edit the Configuration Variables. I tried using GUI, Which says, Cannot overwrite attachment values DATABASE_URL. While I tried using CLI as well. I used the command: heroku config:addDATABASE_URL="postgresql://username:password@IP:PORT". However, this throws an error ........ is not a heroku command.
Solved it. Just for the reference of the users who have the same issue or want to have a similar implementation. Here's the workaround which worked for me.
Heroku no more overwrites databse.yml, so I just modified the DATBASE_URL in the database.yml and pushed it :)
It worked too!
Source : https://discussion.heroku.com/t/rails-4-1-database-yml-no-longer-overwritten-on-heroku/550
这篇关于如何为heroku应用程序更改DATABASE_URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!