将应用程序推送到Heroku的问题

95

我正在尝试将我的应用程序推送到Heroku,但是我收到了以下消息:

$ heroku create
Creating electric-meadow-15..... done
Created http://electric-meadow-15.heroku.com/ | git@heroku.com:electric-meadow-1
5.git

$ git push heroku master

 !  No such app as fierce-fog-63

fatal: The remote end hung up unexpectedly

很奇怪,我以前推送应用到heroku时从来没有问题。现在出现了这个问题尤其奇怪,fierce-fog-63是我很久以前创建并删除的一个旧应用。为什么heroku现在会试图推送到这个不存在的应用程序上,特别是当我已经创建了一个新的应用程序?有什么建议吗?

4个回答

219

输入以下内容,我认为你会看到问题:

git remote -v

可以这样修复:

git remote rm heroku
git remote add heroku git@heroku.com:electric-meadow-15.git

那个方法之前是可以用的...但现在它给了我这个信息:$ git push heroku master Counting objects: 1652, done. Delta compression using up to 4 threads. fatal: object 91f5d3ee9e2edcd42e961ed2eb254d5181cbc734 inconsistent object lengt h (476 vs 8985) error: pack-objects died with strange error error: failed to push some refs to 'git@heroku.com:floating-stone-94.git' - goddamnyouryan
如果有人遇到重命名现有应用程序的问题。 - egbutter
4
@Adam Wiggins 如果您能解释一下您的解决方案,这些命令是做什么的以及为什么它们有效,那将非常有用。 - codeObserver
这个方法对于Python应用程序的同样问题起作用了。除此之外,我还需要在git remote rm heroku之后执行heroku create(我的问题可能略有不同)。 - Patrick Williams

13

我遇到了你发布的第二个错误:"无法将某些引用推送到'git@heroku.com:floating-stone-94.git'"(使用不同的应用程序名称),我通过以下步骤解决了它:

git remote rm heroku
heroku create

你应该看到一行文字,上面写着“Git remote heroku added”。此外

git remote -v

现在应该拥有正确的应用程序。


8
Heroku创建会在Heroku上创建一个全新的项目吗? - thatdankent

5

对于所有无法使用的人,请检查您的~/.heroku/credentials文件。


如果电子邮件或令牌与帐户不匹配,则您将无法看到自己的应用程序。


0
如果你来到这里,认为自己有类似的问题,但是所有其他建议都无效,你可能想尝试:
heroku restart

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接