【问题标题】:How to connect to the selected app with heroku CLI如何使用 heroku CLI 连接到选定的应用程序
【发布时间】:2019-03-13 06:34:02
【问题描述】:

我正在尝试在 Heroku 上部署我的 Java Web 应用程序。当我制作教程时,我使用 heroku create 命令创建了一个应用程序,可以说它是“name-app1”。然后我在教程之后删除了它并创建了新的部署它让它成为:“new_app”。但是,当我尝试执行诸如上传代码之类的操作时,会出现一个错误,即以前的应用程序“name-app1”不再存在。当我尝试使用例如heroku 记录有以下错误:

 »   Error: Missing required flag:
 »     -a, --app APP  app to run command against
 »   See more help with --help

我厌倦了用以下命令指向我的新应用:

git remote set-url heroku git@heroku.com:hidden-ridge-8790.git

我想我搞砸了,不知道如何解决。

【问题讨论】:

    标签: git heroku


    【解决方案1】:

    您尝试为 heroku 设置遥控器的方式不正确。这就是您收到上述错误的原因。 要正确设置遥控器,请使用以下命令

    heroku git:remote -a new_app
    

    这会将您的遥控器设置为新创建的应用new_app

    要部署代码,请使用以下命令

    git push heroku master
    

    这会将您的代码部署到 Heroku 应用程序

    【讨论】:

      【解决方案2】:

      你已经接近了,

      heroku git:remote -a hidden-ridge-8790

      等同于:

      git remote add heroku git@heroku.com:hidden-ridge-8790.git

      尝试一下,如果这不起作用,请向我们展示git remote -v 的输出,我们可以帮助您解决问题。

      【讨论】:

        猜你喜欢
        • 2020-02-19
        • 1970-01-01
        • 2022-06-21
        • 2020-08-17
        • 1970-01-01
        • 2020-09-30
        • 2018-10-21
        • 1970-01-01
        • 2019-01-04
        相关资源
        最近更新 更多