Rails 3.2:Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序
这里是 Rails 新手。我正在尝试将 Rails 3.1/Ruby 1.9.3-p0 应用程序部署到 Heroku,并按照 Heroku 执行了所有步骤。但我不断遇到:
Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序
我已经尝试了 这个问题但到目前为止还没有成功。
Rails newbie here. I'm trying to deploy my Rails 3.1/Ruby 1.9.3-p0 app to Heroku and have followed all the steps according to Heroku. But I keep running into:
Heroku push rejected, no Cedar-supported app detected
I've tried all the suggestions in this question but so far unsuccessful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我也遇到过类似的拒绝。对我有用的是重新初始化 .git 文件。
在命令行中尝试:
I have encountered a similar rejection. What worked for me was reinitializing the .git file.
Try in the command line:
我刚刚用我的一个应用程序解决了这个问题。如果您查看文档,Cedar Stack会在根目录中搜索Gemfile 。就我而言,根目录只有包含我的应用程序的文件夹,其中包含 Gemfile。
因此,您需要做的是在该文件夹中初始化一个新的 git 存储库并添加远程:
然后您就完成了!
I Have just solved this problem with one of my apps. If you check the documentation, the Cedar Stack searches for the Gemfile in the root directory. In my case, the root directory only had the folder containing my app with the Gemfile inside it.
So, what you need to do is to initialize a new git repo inside this folder and add the remote:
And you're done!
每当遇到此错误时,我都会检查以下两件事:
如果您不小心将 Rails 应用程序的父目录置于版本控制中。删除此父目录中的 .git 目录并初始化一个新的存储库,但这次是在 Rails 应用程序目录下。
Whenever I encounter this error, I check the following two things:
If you accidentally put the parent directory of your rails application into version control. Delete the
.git
directory inside this parent directory and initialize a new repository but this time under the Rails application directory.尝试
然后运行
Try
Then run
我之前遇到过这个问题几次,那是因为我试图将远程分支推送到heroku。
为了解决这个问题,而不是使用:
我使用:
这会将 git 存储库中的远程分支
my-branch
推送到 heroku 的master
分支。I have encountered this issue a few time before and it was because I was trying to push a remote branch to heroku.
To solve the problem, instead of using:
I used:
This pushes the remote branch
my-branch
in the git repository to themaster
branch of heroku.我有同样的问题。我的文件结构不是heroku 所期望的(.git 必须与 Gemfile 处于同一级别)。我删除了 Rails_Code 文件夹并且它起作用了。
I have the same problem. My file structure was not what heroku expected (.git must be on the same level as Gemfile). I removed the Rails_Code folder and it worked.
同样的情况,就像 @petwho 上面所说的
“确保 Gemfile 存在于 Rails 应用程序的根目录中。Heroku 使用它来确定要部署的应用程序类型。”
就我而言,不知何故,我的
Gemfiles
和Gemfile.lock
被忽略了。当我在 github 上检查时,我的应用程序没有推送 Gemfile,因为.gitignore
忽略了我的 gemfile。从 gitignore 中删除我的 gemfiles 后,我推送到 heroku ,一切都很顺利
Same Situation, Like @petwho said above
"Make sure the Gemfile exist in root directory of Rails application. Heroku use it to determine what type of application to deploy."
In my case, somehow my
Gemfiles
andGemfile.lock
was being ignored. When I checked on github there was no Gemfile being pushed up with my app due because.gitignore
was ignoring my gemfiles.After removing my gemfiles from gitignore, I pushed to heroku and everything worked smoothly