Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不能推到heroku_Heroku_Key_Public Key - Fatal编程技术网

不能推到heroku

不能推到heroku,heroku,key,public-key,Heroku,Key,Public Key,我已安装Windows 7 Home Premium,其中包括: gem 1.8.24 ruby 1.9.3p385 node 0.8.19 git 1.8.1.msysgit. heroku/toolbelt/2.35.0 (i386-mingw32) ruby/1.9.3 我可以使用:heroku login成功登录到heroku。即使我清除键:heroku键:清除并生成一个新的heroku键:添加我也成功了 当我登录heroku网页->我的帐户时,我已正确添加密钥。我作为合作者加入到项目

我已安装Windows 7 Home Premium,其中包括:

gem 1.8.24
ruby 1.9.3p385
node 0.8.19
git 1.8.1.msysgit.
heroku/toolbelt/2.35.0 (i386-mingw32) ruby/1.9.3
我可以使用:
heroku login
成功登录到heroku。即使我清除键:
heroku键:清除
并生成一个新的
heroku键:添加
我也成功了

当我登录heroku网页->我的帐户时,我已正确添加密钥。我作为合作者加入到项目中

git remote add heroku-s git@heroku.com:secret-project.git
问题是,当我尝试使用以下命令将文件推送到heroku时:

git push heroku-s master
我得到一个错误:

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

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

有什么建议吗?

尝试重新生成公钥(
id\u pub.rsa
),然后再次将其添加到heroku

ssh-keygen -t rsa -C "your_email@youremail.com"
heroku keys:clear
heroku keys:add

对我来说,问题是密钥是在我的HOMEDRIVE上生成的(在我的工作中,这是F://.ssh),但Heroku在C:/Users/MYNAME/.ssh中查找。将id_rsa文件从F:/.ssh复制到C:/Users/MYNAME/.ssh修复了该问题

然后我跑了

heroku.keys:add
之后我就可以

git push heroku master

非常感谢。我只想补充一点。在文件夹c:\users\account\.ssh中删除所有文件(如果不需要)。在生成新密钥的过程中,当我选择其他名称然后选择默认值时,也出现了同样的问题。此外,您还应该通过“git config--global user.email”配置git_email@youremail.com"