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

Git not pushing to Heroku (Permission Denied (publickey))

I'm trying to push my treebook app into heroku but I get the permission denied error even though I have typed "heroku keys:add"

The response is this:

Found existing public key: /Users/ureyes/.ssh/github_rsa.pub
Uploading SSH public key /Users/ureyes/.ssh/github_rsa.pub... done

However, after doing that typing 'git push heroku master' gives me this error:

ssh: Could not resolve hostname heroku.com: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

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

1 Answer

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

You can run

heroku keys

to see a list of all your heroku keys.

Then you can do

heroku keys:remove adam@workstation.local (replace adam@workstation.local with whatever one of your keys is named)

You can remove all your keys.

Then make sure to

heroku login

before you start.

Once logged in, try

ssh-keygen -t rsa

to generate a new key.