I am following the ruby.railstutorial. I run the command "git push heroku master" and it spits out this error.
Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I am inside my rails app "/Users/lexi87/rails_projects/first_app". Any solutions?
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
In your heroku account, go to your app -> Settings. Under App Information, you'll find the heroku git url. answered Sep 7, 2020 at 14:16. sidekickbottom.
The best way to avoid such errors is to use one public/private key pair and not an extra key for heroku. This way you (or your system) can't choose a wrong key to login in heroku.
If you get this error, you have done something wrong. Check this site: https://devcenter.heroku.com/articles/keys
If you geht this error, the best way is to remove unnecessary keys and use only one.
If you need more than one key pair on your system, you can set one key for heroku. This is done through the following command:
heroku keys:add
Some help for Windows 7 users with Github Windows client installed:
Even though heroku toolbelt reports it found my git_hub public key and uploaded it, 'git push heroku master' failed. After taking the steps below, it works fine.
Create .ssh folder under your User folder if one does not exist. If it does, delete all files in it (this assumes you are OK with starting from scratch with ssh keys).
In Windows Explorer, right click the .ssh folder, and choose Git bash from the context menu. This is installed along with the Github Windows client software.
In the bash window enter ssh-keygen -t rsa -C "[email protected]
" When prompted enter a passphrase (don't lose this).
Close the bash shell window.
From a cmd prompt in your project's root, enter heroku keys:add
. This will find and upload the key you just created from your /.ssh file to Heroku.
Now you can enter git push heroku master
to push you app up to Heroku. Note: you will need to add your newly generated ssh public key to your Github account when done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With