【问题标题】:cloned project from github. heroku does not work从 github 克隆的项目。 heroku 不起作用
【发布时间】:2011-01-18 15:18:50
【问题描述】:

我从 github 克隆了一个项目到我的桌面。我以前用笔记本电脑处理它。

然而,在笔记本电脑上 heroku 似乎不适用于这个应用程序,即使我已经安装了它。

第一个问题:

heroku open
>No app specified.
>Run this command from app folder or set it adding --app <app name>

我不必在笔记本电脑上指定--app。因为我猜我最初是在膝上型上执行命令heroku create

第二个问题:

git push heroku master

给出错误

fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

heroku list

 !   This version of the heroku gem has been deprecated.
 !   Please update it by running: gem update heroku

【问题讨论】:

    标签: ruby-on-rails git heroku


    【解决方案1】:

    先做:

    git remote add heroku git@heroku.com:{my-project-name}.git
    

    您将{my-project-name} 替换为出现在您的Heroku 帐户中的Heroku 应用程序的名称。例如,如果您的 Heroku 帐户显示您有一个名为 flowing-water-397 的应用程序,那么该行将是:

    git remote add heroku git@heroku.com:flowing-water-397.git
    

    然后 Git 和 Heroku gem 将知道这个 Git 存储库连接到 Heroku.com 应用程序。然后您可以执行以下操作:

    git push heroku master
    heroku open
    

    最后,进一步了解Git Remotes

    【讨论】:

    • 一时间我一直在想 {my-project-name} 是我本地主机上 myapp 的项目。我很高兴你的回答以某种方式让我在 heroku repo 上使用项目名称哈哈。谢谢。竖起大拇指
    • 在执行此操作之前,我什至无法运行“heroku run bash”。我们一直在设置一个新项目以通过 CodeShip 进行部署,因此不需要为 Heroku 配置我们的 git。现在可以了。
    【解决方案2】:

    除了@Justice提到的git remote add ...,我还需要运行

    git config heroku.remote heroku
    

    (找到解决方案here

    【讨论】:

      【解决方案3】:

      我相信我收到了错误 没有指定应用程序。当我运行任何模棱两可的 heroku 命令时,从应用程序文件夹运行此命令或指定与 --app 一起使用的应用程序。示例:

      heroku logs
      

      这是不明确的,因为我在项目的 .git/config 文件中指定了多个 remote 存储库。我的解决方案是指定远程存储库。示例:

      heroku logs --remote staging
      

      以上行中的--remote staging 对应于我项目的.git/config 文件中的以下内容:

      [remote "staging"]
          url = git@heroku.accountname:foo-bar-1234.git
          fetch = +refs/heads/*:refs/remotes/staging/*
      

      我希望这可以帮助你..如果没有,那么也许它可以帮助其他人!

      【讨论】:

        【解决方案4】:

        当我遇到这个问题时,是因为我在 heroku 上创建了多个远程应用程序。

        要从 heroku 中删除现有的远程应用程序,请使用:

        git remote rm heroku
        

        然后返回并使用 heroku create 重新开始使用 heroku 为您提供的正确应用名称的过程。

        在这里找到的解决方案: solution

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-11-30
          • 2019-04-30
          • 2021-12-21
          • 1970-01-01
          • 2013-01-18
          • 2013-07-12
          • 2019-01-09
          • 1970-01-01
          相关资源
          最近更新 更多