Ruby-on-rails Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8361475/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Heroku push rejected, no Cedar-supported app detected
提问by WHITECOLOR
I'm creating a Rails app with Rails 3.1.3:
我正在使用 Rails 3.1.3 创建一个 Rails 应用程序:
git init
git remote add heroku <my heroku repo>
git add .
git commit -a -m "First commit"
git push heroku master
Got:
得到了:
Counting objects: 102, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (102/102), 315.47 KiB, done.
Total 102 (delta 3), reused 0 (delta 0)
**-----> Heroku receiving push
! Heroku push rejected, no Cedar-supported app detected**
To [email protected]:electric-dusk-3217.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to <my heroku rep>
采纳答案by WHITECOLOR
The problem was that my "Gemfile" was named "gemfile"
问题是我的“Gemfile”被命名为“gemfile”
回答by JnBrymn
I had a similar problem, but with Django (incorrectly named "requirements.txt"). I think to generalize the other answers here, when you get this error it's because Heroku is missing some key file that it uses to identify your app (and its type).
我有一个类似的问题,但与 Django (错误地命名为“requirements.txt”)。我想在这里概括其他答案,当您收到此错误时,这是因为 Heroku 缺少一些用于识别您的应用程序(及其类型)的关键文件。
- php: index.php
- python: requirements.txt
- ruby: Gemfile # note the capitalization
- node: package.json
- php: index.php
- 蟒蛇:requirements.txt
- ruby: Gemfile # 注意大小写
- 节点:package.json
回答by ncherro
I ran into this error message, but my problem was that my rails app was not in the root directory of my git repo. After I moved the files into the root dir, everything worked.
我遇到了这个错误消息,但我的问题是我的 rails 应用程序不在我的 git repo 的根目录中。将文件移动到根目录后,一切正常。
回答by Patrick Fisher
Heroku detects a supported app by looking for specific project files. To find the requirements for your language, start here.
Heroku 通过查找特定的项目文件来检测受支持的应用程序。要查找您的语言要求,请从此处开始。
- For Node.js, you need a
package.json. - For Python applications you need a
requirements.txt. - etc.
- 对于 Node.js,您需要一个
package.json. - 对于 Python 应用程序,您需要一个
requirements.txt. - 等等。
回答by pdobb
Not associated with a new app, but... I ran into this same error message after installing a custom BUILDPACK on heroku and then forgetting about it. The next time I went to deploy to heroku I saw:
与新应用程序无关,但是...我在 heroku 上安装自定义 BUILDPACK 后遇到了同样的错误消息,然后忘记了它。下次我去部署到 heroku 时,我看到:
-----> Fetching custom git buildpack... done
! Push rejected, no Cedar-supported app detected
The fix was to check:
解决方法是检查:
heroku config
And, there, I found a Var called BUILDPACK_URLwhich I had to unset with:
而且,在那里,我发现了一个叫做 Var 的变量BUILDPACK_URL,我必须用它来取消设置:
heroku config:unset BUILDPACK_URL
... and voila!
……瞧!
回答by japhyr
Another cause: I was pushing master, while working on a non-master branch. My master branch didn't have requirements.txt.
另一个原因:我正在推动 master,同时在非 master 分支上工作。我的主分支没有requirements.txt。
I didn't want to push from master, but heroku only pays attention to the master branch. The solution was to push my local branch to heroku's master branch:
我不想从 master 推送,但 heroku 只关注 master 分支。解决方案是将我的本地分支推送到 heroku 的主分支:
git push heroku local_branch:master
回答by James P McGrath
Another cause of this error for Rails apps: we had this deploy error occur when we hadn't removed a git merge conflict from our Gemfile.lock file.
Rails 应用程序出现此错误的另一个原因:当我们没有从 Gemfile.lock 文件中删除 git 合并冲突时,会发生此部署错误。
回答by Dan Sandland
I fixed this by making a superficial change to my Gemfile and recommitting. For some reason it wasn't included in my last commit.
我通过对 Gemfile 进行表面更改并重新提交来解决此问题。出于某种原因,它没有包含在我上次提交中。
回答by Tomasz Kowalczyk
When this problem appears with the project based on static files (only html, css and js) it is recommended to follow this guidlines: https://discussion.heroku.com/t/push-rejected-no-cedar-supported-app-detected/640/3
当基于静态文件(仅 html、css 和 js)的项目出现此问题时,建议遵循以下指南:https: //discussion.heroku.com/t/push-rejected-no-cedar-supported-app -检测到/640/3
回答by 2016rshah
I was following the RailsTutorial.orgsteps and this error showed up. None of the answers on this post worked. Then I saw this commentthat led to this answerwhich was the only thing that worked for me so that might solve other people's problems with the tutorial as well.
我按照RailsTutorial.org 的步骤操作,结果出现了这个错误。这篇文章中的所有答案都没有奏效。然后我看到这条评论导致了这个答案,这是唯一对我有用的东西,这样也可以解决其他人在本教程中的问题。

