Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.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
Ruby on rails 带有Heroku的Ruby on Rails:致命:没有配置推送目标_Ruby On Rails_Git_Heroku - Fatal编程技术网

Ruby on rails 带有Heroku的Ruby on Rails:致命:没有配置推送目标

Ruby on rails 带有Heroku的Ruby on Rails:致命:没有配置推送目标,ruby-on-rails,git,heroku,Ruby On Rails,Git,Heroku,我正在尝试用Heroku部署我的应用程序,我正在使用YouTube上的教程,我被教程中告诉你进入终端的部分卡住了 git push 在许多其他命令之后。当我输入该命令时,我得到以下消息 fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using git remote add <name>

我正在尝试用Heroku部署我的应用程序,我正在使用YouTube上的教程,我被教程中告诉你进入终端的部分卡住了

git push
在许多其他命令之后。当我输入该命令时,我得到以下消息

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>
我不知道该放什么,我该放什么

如果你想知道的话,我正在使用下面链接的教程

命令中的错误告诉您的是,没有可将代码发送到的配置位置。在您的问题背景下,这意味着您尚未在回购协议中为Heroku应用程序设置URL

您可以通过运行git remote-v进行双重检查,它不应该包含输出或至少包含一个heroku url

要解决此问题,请转到Heroku应用程序实例并查找应用程序的.git url。这提供了一个地址,您可以将应用程序推送到该地址

一旦你做到了这一点,你应该能够做到以下几点

git remote add heroku https://git.heroku.com/<your-app-name>.git

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

git push heroku master
供参考:


按照教程中的所有步骤操作

问题在于他没有定义远程heroku Yes需要按照教程中的所有步骤操作他需要配置git和heroku,请查看此链接仔细遵循所有步骤这将导致成功部署
git push heroku master