Mellon Mellon - 1 year ago 82
Git Question

Newbie in Heroku: Error when push my app to Heroku

I am using Ubuntu 10.04. By following the tutorial here, I have created Heroku account, installed GIT and Heroku successfully. I have uploaded the SSH key and add heroku to my system PATH.

After that, I did the following thing:

---------- FIRST (successful)-------------

$ git init
Initialized empty Git repository in .git/
$ touch HELLO
$ git add .
$ git commit -m "Add a HELLO file"

------------THEN (successful)----------

$ heroku create
Enter your Heroku credentials.
Uploading ssh public key /Users/joe/.ssh/
Created |
Git remote heroku added

----------- LAST (Which failed!!!)----------

$ git push heroku master

Warning: Permanently added the RSA host key for IP address 'xx.xx.xx.xx' to the list of known hosts.
Counting objects: 3, done.
Writing objects: 100% (3/3), 226 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
-----> Heroku receiving push

! Heroku push rejected due to an unrecognized error.
! We've been notified, see if the problem persists.

! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ''

As you see above, my LAST step failed.

What could be the possible reason for the error in my LAST step(when push my app to Heroku)?Why it is failed?

Answer Source

You cannot push any random repo to Heroku. It has to be a rails app ( or any of the other supported apps like Django, but in this case OP is working on Rails) and that is what the pre-receive hook is rejecting in your case since your repo just has some dummy file. ( NOTE that the first step in the tutorial is not creating an empty git repo, but creating one for your Rails app. See the output in the successful push example in the quickstart - Rails app detected - means it looks for the rails app when you push something.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download