Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
虽然我只得到了一个应用程序,但在每个heroku命令中都写应用程序名还是很无聊_Heroku_Heroku Toolbelt - Fatal编程技术网

虽然我只得到了一个应用程序,但在每个heroku命令中都写应用程序名还是很无聊

虽然我只得到了一个应用程序,但在每个heroku命令中都写应用程序名还是很无聊,heroku,heroku-toolbelt,Heroku,Heroku Toolbelt,Heroku toolbelt总是强迫我在末尾写一个应用程序名,如下所示: heroku pg:reset DATABASE --app [app_name] 是否有方法设置所有my CLI heroku命令将应用到的默认应用程序?如果从链接到heroku应用程序的Git repo运行heroku,则无需指定应用程序名称(除非repo连接到多个应用程序).如果heroku声称文件夹中有多个应用程序,则.git/config中必须有多个远程应用程序 删除额外的heroku remote,或使用g

Heroku toolbelt总是强迫我在末尾写一个应用程序名,如下所示:

heroku pg:reset DATABASE --app [app_name]

是否有方法设置所有my CLI heroku命令将应用到的默认应用程序?

如果从链接到heroku应用程序的Git repo运行heroku,则无需指定应用程序名称(除非repo连接到多个应用程序).

如果heroku声称文件夹中有多个应用程序,则.git/config中必须有多个远程应用程序


删除额外的heroku remote,或使用git config heroku.remote remote\u name设置默认值

发布此文件,以防它帮助其他人。即使只安装了一个应用程序,我也有同样的问题。我不得不将我的heroku远程url从https切换到git

git@heroku.com:[heroku-app-1234]。git

然后我自己一切正常

git remote remove heroku
git remote add heroku git@heroku.com:[heroku-app-1234].git

如果您安装了heroku帐户插件,请切换到“为我工作”,如中所述

要替换现有版本的heroku帐户插件,请使用:

heroku plugins:install https://github.com/heroku/heroku-accounts.git

请注意,如果您遵循@Moemars answer,则需要将git remote切换回https。

这似乎是解决此问题的最简单方法:

heroku git:remote -a <app_name>
heroku git:remote-a
因为直到现在才提到这一点:

除了git remote之外,Heroku CLI还查看
Heroku\u APP
环境变量


通过使用、dotenv或类似工具用于特定于项目的环境,您可以轻松地为每个项目或目录设置相应的Heroku应用程序。

我正在从rails应用程序根目录(与github和Heroku链接的git repo)启动所有命令,它是这么说的:!文件夹中有多个应用程序,但未指定任何应用程序!使用--app app指定app。顺便说一句:我在dashboard.heroku.com/appsAny解决方案中只有一个应用程序用于非git应用程序(例如用于
container
stack)?这对我不起作用。我不得不删除由此生成的git/config行,并使用
git-remoteadd-herokugit@heroku.com:[heroku-app-1234].git
instead这在被接受的答案不起作用的地方起作用