Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Heroku Deploying error

After inputting git push heroku master in the terminal I get the following error:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Then I inputted heroku keys:add in the terminal and I get this response:

myname-MacBook-Pro:treebook myname$ heroku keys:add
Found existing public key: /Users/myname/.ssh/github_rsa.pub
Uploading SSH public key /Users/myname/.ssh/github_rsa.pub... done

Then I try git push heroku master and then I get this response:

myname-MacBook-Pro:treebook myname$ git push heroku master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
myname-MacBook-Pro:treebook myname$ 

Any help would be greatly appreciated!

Thanks, Ian

1 Answer

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Ian Warner I'm not 100% sure but did you add your key to the current session? If not try doing the following:

ssh-add ~/.ssh/github_rsa
James Barnett
James Barnett
39,199 Points

+1 for this tip

For more info on SSH keys & Heroku check out: https://devcenter.heroku.com/articles/keys

Hey Jason & James, Thanks for the tip it worked by doing the following steps in terminal:

ssh-keygen -t rsa 

then

heroku keys:add  

then choosing option 2 below:

Found the following SSH public keys:
1) github_rsa.pub
2) id_rsa.pub

Then

git push heroku master

and it worked! :)

Thanks for your help guys!

Ian