2010-02-19 70 views
36

我从github克隆了一个项目到我的桌面。我曾经在我的笔记本电脑上工作。从github克隆的项目。 heroku不起作用

但是,在笔记本电脑上,heroku似乎不适用于此应用程序事件,但我已安装它。

第一个问题:

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

我没有指定我的笔记本电脑的--app。因为我想我最初在lapop上命令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 

回答

71

先做:

git remote add heroku [email protected]:{my-project-name}.git 

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

git remote add heroku [email protected]:flowing-water-397.git 

然后Git和Heroku的宝石就会知道这混帐回购协议连接到Heroku.com应用。然后,你可以做的事情,如:

git push heroku master 
heroku open 

最后,了解多一点关于Git Remotes

+0

有一刻我一直在想{my-project-name}是myapp在本地主机上的项目。即时通讯高兴你的答案以某种方式卡住了我使用heroku回购项目名称哈哈。谢谢。竖起大拇指 – Sasha 2012-02-29 21:16:32

+0

@Crystal谢谢,我说得更清楚一些。 – yfeldblum 2012-02-29 21:40:52

+0

我甚至不能运行'heroku运行bash',直到我这样做。我们一直在建立一个通过CodeShip部署的新项目,所以不需要为Heroku配置我们的git。现在它可以工作。 – ChrisPhoenix 2013-11-13 00:39:42

9

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

git config heroku.remote heroku 

(溶液发现here

2

当我有这个问题,那是因为我创造了多个远程应用程序在heroku上。

从Heroku的使用删除现有的远程应用:

git remote rm heroku 

再回去使用Heroku的创建启动进程在使用正确的应用程序名称的Heroku给你。

发现的解决方案在这里: solution

4

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

heroku logs 

这是明确的,因为我有我的项目的.git/config文件中指定的多个远程。对我来说这个解决方案简直就是指定远程仓库。例如:

heroku logs --remote staging 

在上面的线--remote staging相当于我的项目的.git/config文件中的以下内容:

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

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