110

I'm creating a Rails app with Rails 3.1.3:

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 git@heroku.com:electric-dusk-3217.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to <my heroku rep>
WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181

13 Answers13

154

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).

  • php: index.php
  • python: requirements.txt
  • ruby: Gemfile # note the capitalization
  • node: package.json
JnBrymn
  • 24,245
  • 28
  • 105
  • 147
  • 6
    Found another answer to this problem here (re-initialize the git repo): http://stackoverflow.com/questions/9305370/rails-3-2-heroku-push-rejected-no-cedar-supported-app-detected – Chris Sep 20 '13 at 01:55
  • Friendly reminder: also have a Procfile, if running web app be sure there is a webservice enabled via Procfile pointing to correct script. Also be sure web dyno is turned on for app in Heroku admin. ```remote: ----->Discovering process types...Procfile declares types -> web``` is via my Procfile – Marc Jul 13 '15 at 18:06
  • Thanks, adding requirements.txt helped me! Please note that you should commit it (add it to the git repo) and then try to push again.. – ItayB Feb 07 '16 at 17:08
48

The problem was that my "Gemfile" was named "gemfile"

WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181
  • @Whitecolor Had the exact same issue and your solution worked! Then ran into other complicated problems after. But thank you. – Tony Jan 11 '12 at 07:21
  • 1
    Not only did this happen for me, but in a non-obvious way. Working in OSX, even with a file called `Gemfile`, if I do `vi gemfile`, it opens my `Gemfile`, and then upon saving renames it to `gemfile` without warning! – B Seven Sep 23 '12 at 18:21
  • I guess this is a good reason to set up a partition that distinguishes between uppercase and lowercase characters... – B Seven Sep 23 '12 at 18:21
  • 2
    what's the "Gemfile" ? i have a html game and i want to push it in heroku. and i get the same error – Alaeddine Mar 24 '14 at 10:49
45

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.

ncherro
  • 2,604
  • 2
  • 24
  • 20
  • 3
    That seems like a poor solution. Is there a proper way to push the app while its in a subdirectory? – y0mbo Apr 27 '12 at 21:06
  • 1
    I'm using [git-subtree](https://github.com/apenwarr/git-subtree). I had trouble installing so I used [this help](http://stackoverflow.com/questions/11603510/how-do-i-correctly-install-the-tools-in-gits-contrib-directory) – Rian Rainey Oct 21 '12 at 22:43
  • I had the same problem - I was just starting with the heroku getting started for RoR and encountered this issue. Thanks for the fix. – Mahendra Liya Nov 06 '13 at 20:22
  • I kept checking the commandline and it was "correct" but then I noticed I was in /home/myapp/myapp... doh... – Will Dec 23 '15 at 09:27
  • My case, too. I `git init` my app folder as git root directory then the push to heroku went through. Thanks. – Sophia Feng Jan 31 '16 at 02:46
26

Heroku detects a supported app by looking for specific project files. To find the requirements for your language, start here.

Patrick Fisher
  • 7,926
  • 5
  • 35
  • 28
22

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:

-----> 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_URL which I had to unset with:

heroku config:unset BUILDPACK_URL

... and voila!

pdobb
  • 17,688
  • 5
  • 59
  • 74
12

Another cause: I was pushing master, while working on a non-master branch. My master branch didn't have 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:

git push heroku local_branch:master
japhyr
  • 1,710
  • 2
  • 18
  • 24
7

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.

James P McGrath
  • 1,856
  • 1
  • 20
  • 35
3

I had the same issue. "Gemfile" was included in ".gitignore" and has therefore not been part of the deployment. Heroku requires Gemfile for Rails projects.

Alexei Danchenkov
  • 2,011
  • 5
  • 34
  • 49
3

I fixed this by making a superficial change to my Gemfile and recommitting. For some reason it wasn't included in my last commit.

Dan Sandland
  • 7,095
  • 2
  • 29
  • 29
3


I met the same problem here.
My check as follow:
1. Make sure "foreman start" works well locally.
2. Make sure only one new app create on your heroku account.
Hope it help.

Evan Lin
  • 1,272
  • 1
  • 12
  • 25
3

I was following the RailsTutorial.org steps and this error showed up. None of the answers on this post worked. Then I saw this comment that led to this answer which was the only thing that worked for me so that might solve other people's problems with the tutorial as well.

Community
  • 1
  • 1
2016rshah
  • 671
  • 6
  • 19
  • I think the cause is that I init the repo on parent directory of the RAIL_PROJECT directory. So make cedar can't recognize what type of the app is. Thanks for your answer! – Robert Mar 10 '16 at 06:08
3

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

Tomasz Kowalczyk
  • 1,873
  • 2
  • 23
  • 33
2

I also had the problem with django based app. Everything seemed to be ok: file names and other settings.

The problem was that in heroku console there was a BUILDPACK_URL setting defined for node.js - thus django application was rejected.

Opal
  • 81,889
  • 28
  • 189
  • 210