【问题标题】:Heroku CLI - How to solve the Error: Missing required flag: -a --app APP?Heroku CLI - 如何解决错误:缺少必需的标志:-a --app APP?
【发布时间】:2020-01-27 22:45:48
【问题描述】:

我设法部署了一个使用 Postgres 但运行不出错的 Scala Play 2.7 应用程序:

(base) bravegag@Zeus:~/code/myapp$ heroku open
 ›   Error: Missing required flag:
 ›     -a, --app APP  app to run command against
 ›   See more help with --help
(base) bravegag@Zeus:~/code/myapp$ heroku logs --tail
 ›   Error: Missing required flag:
 ›     -a, --app APP  app to run command against
 ›   See more help with --help

我该如何解决这个问题?

【问题讨论】:

    标签: heroku heroku-cli


    【解决方案1】:

    首先你需要初始化 git(这是 Heroku 所必需的)

        $ git init
        $ git add .
        $ git commit -m "first"
    

    那你应该

        $ heroku git:remote -a your_app_name
    

    然后你终于可以:

        $ heroku container:push web
    

    【讨论】:

      【解决方案2】:

      您需要先将 git remote 设置为您的应用程序,否则 heroku 不会检测到您的标志,

      heroku git:remote -a your_app_name
      

      【讨论】:

        【解决方案3】:

        这是一个 heroku cli 标志,而不是 scala/play。只需在使用 heroku cli 时指定您的 heroku 应用程序的名称:

        $ heroku open --app <app-name>
        

        (其他命令相同)

        您可以在 heroku 仪表板中找到您应用的名称(在 https://heroku.com 中的某处)

        如果您在 heroku 中输入您的应用程序,您将访问类似 https://dashboard.heroku.com/apps/&lt;app-name&gt; 的链接

        【讨论】:

          猜你喜欢
          • 2019-01-19
          • 1970-01-01
          • 1970-01-01
          • 2018-07-19
          • 2021-08-17
          • 2019-02-28
          • 1970-01-01
          • 2021-04-11
          • 2012-01-27
          相关资源
          最近更新 更多