【问题标题】:Ruby on Rails with Heroku: fatal: No configured push destination使用 Heroku 的 Ruby on Rails:致命:未配置推送目标
【发布时间】:2017-07-05 15:14:40
【问题描述】:

我正在尝试使用 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>

我不知道该放什么,我必须放什么?

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

【问题讨论】:

    标签: ruby-on-rails git heroku


    【解决方案1】:

    为了部署您的代码,请使用推送您的代码的命令

    git push heroku master
    

    供您参考:tutorial

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

    【讨论】:

    • 问题是他还没有定义远程heroku
    • 他需要按照教程中的所有步骤进行操作
    • 他需要配置git和heroku,看这个链接按照所有步骤小心,这将导致成功部署
    【解决方案2】:

    该命令的错误告诉您没有配置的位置可以将您的代码发送到。这在您的问题上下文中意味着您没有在您的存储库中为您的 Heroku 应用设置 URL。

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

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

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

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

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

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

    git push heroku master
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-02
      • 2018-07-18
      • 2017-10-03
      • 1970-01-01
      • 2012-04-19
      • 1970-01-01
      相关资源
      最近更新 更多