【问题标题】:Command to run heroku run rake db:migrate on production db when you also have a staging db in heroku运行 heroku 的命令 run rake db:migrate 当您在 heroku 中还有一个暂存数据库时,在生产数据库上迁移
【发布时间】:2017-08-27 02:56:43
【问题描述】:

我有一个 ruby​​ on rails 应用程序,利用在 heroku 中运行的 Postgres。我在heroku中有一个暂存环境和一个生产环境。我想在生产环境中运行 heroku run rake db:migrate 但是我可以找到执行此操作的命令,任何帮助将不胜感激

【问题讨论】:

  • 在您的.git/config 中,Heroku 上的远程源是如何命名的?

标签: ruby-on-rails ruby postgresql heroku


【解决方案1】:

当我运行 heroku run rake db:migrate --remote 时,它​​给了我三个选择(heroku、staging 和 test),我运行了命令:heroku run rake db:migrate --remote heroku,它成功了!! (不明白 Heroku 将我的生产环境称为“heroku”而不是生产环境)再次感谢您的帮助

【讨论】:

    【解决方案2】:

    我认为您可以设置遥控器以使其选择正确的环境:

    heroku run rake db:migrate --remote production
    

    【讨论】:

    • Femi 非常感谢您的帮助,很遗憾我收到错误消息:找不到 git 远程生产
    • 和遥控器:heroku 分段测试,还有其他想法吗?再次感谢您的帮助:)
    • 试试heroku run rake db:migrate --remote heroku ?基本上,如果您列出所有环境(我想您说过您有 herokustagingtest),您应该能够指定一个作为目标。
    • 再次感谢您的帮助!!我运行了该命令,然后打开 heroku 并打开了我的登台应用程序......然后我查看了我的网址,我的生产应用程序中的图片不见了......不确定这是否有效还有其他建议吗?
    猜你喜欢
    • 1970-01-01
    • 2016-04-19
    • 2011-10-29
    • 2017-01-07
    • 2016-11-18
    • 2014-03-21
    • 2012-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多