Heroku上的Web dyno崩溃后出现“错误:git远程中有多个应用程序”

时间:2020-08-03 12:53:46

标签: heroku

我正在按照here步骤设置过渡环境。

heroku create --remote staging

我检查了网站,并创建了一个新应用。然后,我尝试将一个特定的分支推送到它:

git push --remote staging  my_branch:master

创建了一个内部版本,我收到一条消息,指出已将其部署到应用程序的URL。但是当我去那里时,它显示了一个Application Error。日志报告了此问题:

Error: Multiple apps in git remotes
  Usage: --remote staging
  or: --app <app_name>
  Your local git repository has more than 1 app referenced in git remotes.
  Because of this, we can't determine which app you want to run this command against.
  Specify the app you want with --app or --remote.
  Heroku remotes in repo:
  <original_app_name> (heroku)
  <new_app_name> (staging)

我尝试了使用--remote app_name--app app_name的各种组合,但出现了unknown option这样的错误:

error: unknown option `remote'
usage: git push [<options>] [<repository> [<refspec>...]]

我想念什么?

1 个答案:

答案 0 :(得分:1)

您正在将git命令参数与heroku混淆。 git push没有--remote参数;要进行部署,只需在命令行上提供远程名称:

git push staging my_branch:master

我认为您实际上已经正确地做到了,因为您看到了部署。

现在,您看到的错误消息不是应用程序错误。 heroku CLI logs command的一个错误是告诉您它不知道它应该显示生产应用程序的日志还是暂存的日志。

尝试

heroku logs --remote staging

heroku logs --app <new_app_name>

查看实际的服务器端日志,其中应包含有关应用程序崩溃的详细信息。

相关问题