Sunday, July 19, 2015

Heroku - Push rejected, no Cedar-supported app detected

If you just created a new Heroku app and doing a first master push, and seeing the following error:

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote:
remote:  !     Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the buildpack
remote:       to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to myapp.
remote:


One possible cause is that you are missing some key file that it uses to identify your app:
  • php: index.php
  • python: requirements.txt
  • ruby: Gemfile
  • node: package.json 

So for example, I use Python as my build packs, so I need to add a "requirements.txt" (even empty) in my app folder:
$ cd ~/myapp
$ touch requirements.txt
$ git add .
$ git commit
$ git push heroku master

Counting objects: 6, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 524 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Python app detected
remote: -----> Installing runtime (python-2.7.10)
remote: -----> Installing dependencies with pip
remote: You must give at least one requirement to install (see "pip help install")
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> (none)
remote:
remote: -----> Compressing... done, 34.9MB
remote: -----> Launching... done, v5
remote:        https://myapp.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.

To https://git.heroku.com/myapp.git
 * [new branch]      master -> master


No comments: