Heroku权限被拒绝/无法连接到heroku api [英] Heroku permission denied / unable to connect to heroku api

查看:694
本文介绍了Heroku权限被拒绝/无法连接到heroku api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将git设置并成功推送到Heroku大约6个月(在Mac上使用Github应用程序的mac)。

昨天突然我可以不再推送到heroku的变化,我得到了这个错误消息:

pre $ git push heroku master

权限被拒绝(publickey)。
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限
并存在存储库。

在环视了一下后,它似乎可能是我的钥匙有问题。
我创建了一个新的密钥并将其添加到了似乎可以工作的heroku中:
$ b $ pre $ code $ ssh-keygen -t rsa
生成公钥/私钥rsa密钥对。
输入要保存密钥的文件(/Users/kat/.ssh/id_rsa):
输入密码(空密码):
再次输入相同的密码:
您的身份已保存在/Users/kat/.ssh/id_rsa中。
您的公钥已保存在/Users/kat/.ssh/id_rsa.pub。

$ heroku keys:add
找到现有公钥:/Users/kat/.ssh/github_rsa.pub
上传SSH公钥/Users/kat/.ssh/github_rsa .pub ...完成

但是,当我尝试推送到Heroku时,我现在得到了一个不同的错误:

  $ git push heroku master 
致命:'heroku'似乎不是git存储库
致命:无法从远程存储库读取。

任何建议都将不胜感激,谢谢

解决方案

它看起来像是英雄遥控器在途中迷路了。在shell中执行 git remote -v ,并检查是否有配置为推送的heroku分支。它应该是这样的:



heroku git@heroku.com:myrepo.git(push) p>

如果没有设置远程分支,请执行 heroku git:remote -a my-app-name 和它应该配置它。有关更多详细信息,另见这篇文章


I've had git set up and pushed to Heroku successfully for about 6 months ( on a mac using the Github app for mac).

Yesterday suddenly I can no longer push change to heroku, I got this error message:

$ git push heroku master

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

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

After looking around a bit it seemed it might be a problem with my key. I created a new key and added it to heroku which seemed to work:

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/kat/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/kat/.ssh/id_rsa.
Your public key has been saved in /Users/kat/.ssh/id_rsa.pub.

$ heroku keys:add
Found existing public key: /Users/kat/.ssh/github_rsa.pub
Uploading SSH public key /Users/kat/.ssh/github_rsa.pub... done

But I am now getting a different error when I try to push to Heroku:

$ git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Any suggestions would be much appreciated, thanks

解决方案

It looks like the heroku remote got lost somewhere along the way. Do git remote -v in your shell and check if there is a "heroku" branch configured for push. It should look like this:

heroku git@heroku.com:myrepo.git (push).

If there isn't a remote branch set up, do heroku git:remote -a my-app-name and it should configure it. See also this article for more details.

这篇关于Heroku权限被拒绝/无法连接到heroku api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆