Rails 3.2: Heroku push rejected, no Cedar-supported app detected

ぐ巨炮叔叔 提交于 2019-11-26 15:41:25

问题


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.


回答1:


I have encountered a similar rejection. What worked for me was reinitializing the .git file.

Try in the command line:

rm -rf .git
git init
git add .
git commit -am "Reinitialize"
heroku create --stack cedar
git push heroku master



回答2:


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:

$ cd my_app_folder
$ git init
$ git add .
$ git commit -m "Heroku commit"
$ git remote add heroku git@heroku.com:my-app-in-heroku.git
$ git push heroku master

And you're done!




回答3:


Whenever I encounter this error, I check the following two things:

  • Make sure the Gemfile exist in root directory of Rails application. Heroku use it to determine what type of application to deploy.
  • Make sure the Rails app root directory itself is put under version control (e.g: Git) rather than its parent directory.

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.




回答4:


Try

$ git init
$ git add .
$ git commit -m "Change to something"

Then run

git push heroku master



回答5:


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:

git push heroku master

I used:

git push heroku my-branch:master

This pushes the remote branch my-branch in the git repository to the master branch of heroku.




回答6:


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.

Project\
         .git
         Rails_Code\
                     Gemfile
                     etc...



回答7:


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 and Gemfile.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



来源:https://stackoverflow.com/questions/9305370/rails-3-2-heroku-push-rejected-no-cedar-supported-app-detected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!