Git推送到heroku被拒绝(非快进更新)

时间:2013-10-09 17:16:12

标签: git node.js heroku

我尝试回到之前的git提交。现在我想把它推回到heroku。

git push staging-heroku staging:master

To git@heroku.com:MyApp.git
 ! [rejected]        staging -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:MyApp.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

我搜索了Stackoverflow,他们说的是

git push -f git@heroku.com:<heroku repo name>.git

我试过了,我得到了

Total 0 (delta 0), reused 0 (delta 0)


 !     Push rejected, no Cedar-supported app detected

To git@heroku.com:MyApp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@MyApp.git'

更新

Winfield建议检查我的Procfile

cat Procfile

web: node app.js

git add Procfile和git push -f git@heroku.com:MyApp.git给了我同样的错误信息。

1 个答案:

答案 0 :(得分:1)

您看到的当前错误是Heroku Ruby buildpack未能从您的git repo中识别并集成Ruby应用程序。

这意味着您缺少以下一项或多项:

  • Gemfile使用gem depdencies和ruby version
  • Procfile运行一个或多个ruby进程