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

7

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.

Etheleneethelin answered 16/2, 2012 at 4:4 Comment(4)
I realise I'm running ruby 1.9.3-p0 and followed the steps in railsapps.github.com/rails-heroku-tutorial.html but hasn't helped so far. Could it be Heroku and their experimental support for 1.9.3?Etheleneethelin
No, I run a 1.9.3 app on heroku just fine. How did you create your app on heroku? Did you do: heroku apps:create myapp --stack cedar ?Dionysus
Yes I ran heroku create myapp --stack cedarEtheleneethelin
OK I got it working although I wouldn't consider this a fix! I created another sample app with the same gemfile and deployed it to Heroku which worked fine. I then copied all files over from my other app to this new one and pushed it to the same heroku repo.. and it worked!Etheleneethelin
I
74

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
Incept answered 20/7, 2012 at 0:32 Comment(3)
Before you take this drastic step, you might check that you're on the master branch. Heroku ignores non-master branches. If this is your issue, you can either switch to master and deploy from there, or push your non-master branch to heroku's master branch: git push heroku branch_name:master.Smokestack
Great answer, but if you're using PowerShell like me, you'll want rm -Recurse -Force .gitHerwig
I wouldn't jump straight to smashing your entire repository's history, branches, remotes, etc. Just breathe a minute before you do this.Californium
H
8

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 [email protected]:my-app-in-heroku.git
$ git push heroku master

And you're done!

Housefather answered 25/10, 2013 at 11:38 Comment(0)
D
7

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.

Dru answered 15/9, 2014 at 2:25 Comment(0)
V
5

Try

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

Then run

git push heroku master
Vardar answered 16/2, 2012 at 4:34 Comment(2)
Tried that and also did it again by cloning the repo into a new directory but still didn't work.Etheleneethelin
when you reinitialize your files for github. Were your files added to github and ready to be pushed?Vardar
S
3

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.

Society answered 22/12, 2014 at 17:52 Comment(0)
O
0

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...
Overnight answered 5/12, 2015 at 18:0 Comment(0)
S
0

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

Sandiesandifer answered 9/1, 2016 at 21:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.