1

I'm trying to deploy my Rails app on heroku.

But on All things it would have to fail at the very last step.

My git is all set up, I got a working git repository, a heroku account, installed the heroku_toolbelt and I can login via "heroku login"

I also can create a new repository with "heroku create" and do get my url path and the feedback "git remote heroku added".

But trying to push it on heroku with "git push heroku master" fails and results in the following message:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What kind of public key is being needed? and i Know the repository exists, it's there on my heroku account :/

I hope you can help me out!

Sir Jay
  • 59
  • 2
  • possible duplicate of [Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly](http://stackoverflow.com/questions/4269922/permission-denied-publickey-when-deploying-heroku-code-fatal-the-remote-end) – Damien MATHIEU Jun 25 '13 at 19:18

1 Answers1

1

You need to add your public key to Heroku - asumming you have one in your ~/.ssh folder (it would typically be called id_rsa.pub). If not generate one with ssh-keygen

heroku keys:add

should sort the problem out and you should be able to push your application.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
  • all right i fixed the ssh-key problem, but now I can't seem the push to the correct app. The repository heroku tries to push to does not exist any longer (I deleted it). But when creating a new one, it still refers to the old one. Using "git remote add second-heroku-app git@heroku.com:appname.git" didn't help... – Sir Jay Jun 26 '13 at 08:54
  • 1
    if you've done git remote add second-heroku-app then your push will be `git push second-heroku-app master` – John Beynon Jun 26 '13 at 09:14