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

时间:2021-01-28 20:39:54

I'm trying to deploy my app with Heroku, I'm using a tutorial from YouTube and I'm stuck on a part in the tutorial that tells you to enter in the terminal...

我正在尝试使用Heroku部署我的应用程序,我正在使用来自YouTube的教程,而且我已经停留在教程的一部分,告诉您进入终端...

git push

after many other commands. When I did enter that command, I get the following message

经过许多其他命令。当我输入该命令时,我收到以下消息

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>

I'm not sure what to put in, what do I have to put in?

我不确定要放什么,我需要放什么?

In case you are wondering, I'm using the tutorial with the below link https://www.youtube.com/watch?v=mabGJ-vuABc

如果您想知道,我正在使用以下链接的教程https://www.youtube.com/watch?v=mabGJ-vuABc

2 个解决方案

#1


1  

For deploy your code following command use for push your code

使用命令部署代码以推送代码

git push heroku master

For your reference : tutorial

供您参考:教程

Follow all steps as in tutorial

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

#2


0  

What the error from the command is telling you is that there's no configured place to send your code to. What this means in the context of your problem is that you have not set up the URL in your repo for your Heroku app.

该命令的错误告诉您的是,没有配置位置来发送您的代码。在您的问题的上下文中,这意味着您没有在您的Hero应用程序的repo中设置URL。

You can double check this by running git remote -v which should not contain an output or at least one that has a heroku url on it.

您可以通过运行不应包含输出的git remote -v或至少一个包含heroku url的输出来仔细检查。

To fix this, go to your Heroku app instance and look for the .git url for the application. This provides an address to which you can push your application to.

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

Once you have that, you should be able to do the following

完成后,您应该能够执行以下操作

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

This will create a remote called heroku which will point to the URL provided by your application to your application's repo in Heroku.

这将创建一个名为heroku的远程,它将指向您的应用程序提供给Heroku中应用程序的repo的URL。

Then to push your code you can run:

然后推送你的代码你可以运行:

git push heroku master

#1


1  

For deploy your code following command use for push your code

使用命令部署代码以推送代码

git push heroku master

For your reference : tutorial

供您参考:教程

Follow all steps as in tutorial

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

#2


0  

What the error from the command is telling you is that there's no configured place to send your code to. What this means in the context of your problem is that you have not set up the URL in your repo for your Heroku app.

该命令的错误告诉您的是,没有配置位置来发送您的代码。在您的问题的上下文中,这意味着您没有在您的Hero应用程序的repo中设置URL。

You can double check this by running git remote -v which should not contain an output or at least one that has a heroku url on it.

您可以通过运行不应包含输出的git remote -v或至少一个包含heroku url的输出来仔细检查。

To fix this, go to your Heroku app instance and look for the .git url for the application. This provides an address to which you can push your application to.

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

Once you have that, you should be able to do the following

完成后,您应该能够执行以下操作

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

This will create a remote called heroku which will point to the URL provided by your application to your application's repo in Heroku.

这将创建一个名为heroku的远程,它将指向您的应用程序提供给Heroku中应用程序的repo的URL。

Then to push your code you can run:

然后推送你的代码你可以运行:

git push heroku master