Ruby on rails git@github.com:权限被拒绝(公钥)。致命:无法从远程存储库读取。云端9

Ruby on rails git@github.com:权限被拒绝(公钥)。致命:无法从远程存储库读取。云端9,ruby-on-rails,ubuntu,deployment,vps,ubuntu-server,Ruby On Rails,Ubuntu,Deployment,Vps,Ubuntu Server,我正在尝试使用中的步骤在线部署rails站点,但是当我运行cap production deploy时,我收到了一个问题,我可以做些什么来修复它,请注意,我使用的是aws cloud 9 deploy@93.188.163.140's password: 00:00 git: wrapper 01 mkdir -p /tmp ✔ 01 deploy@X.X.X.X 0.158s Uploading /tmp/git-ssh-young-production-ubu

我正在尝试使用中的步骤在线部署rails站点,但是当我运行
cap production deploy
时,我收到了一个问题,我可以做些什么来修复它,请注意,我使用的是aws cloud 9

deploy@93.188.163.140's password:
00:00 git: wrapper
      01 mkdir -p /tmp
    ✔ 01 deploy@X.X.X.X 0.158s
      Uploading /tmp/git-ssh-young-production-ubuntu.sh 100.0%
      02 chmod 700 /tmp/git-ssh-young-production-ubuntu.sh
    ✔ 02 deploy@93.188.163.140 0.156s
00:00 git:check
      01 git ls-remote git@github.com:oomis/young.git HEAD
      01 Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
      01 git@github.com: Permission denied (publickey).
      01 fatal: Could not read from remote repository.
      01
      01 Please make sure you have the correct access rights
      01 and the repository exists.
#<Thread:0x0000564f38e1cb38@/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        13: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'

.```

I expect it to deploy my app, how can I fix this, please
deploy@93.188.163.140的密码:
00:00吉特:包装器
01 mkdir-p/tmp
✔ 01deploy@X.X.X.X0.158s
上传/tmp/git-ssh-young-production-ubuntu.sh 100.0%
02 chmod 700/tmp/git-ssh-young-production-ubuntu.sh
✔ 02deploy@93.188.163.1400.156s
00:00吉特:支票
01吉特ls远程git@github.com:oomis/young.git HEAD
01警告:已将IP地址“140.82.113.4”的RSA主机密钥永久添加到已知主机列表中。
01git@github.com:权限被拒绝(公钥)。
01致命:无法从远程存储库读取。
01
01请确保您拥有正确的访问权限
01,并且存储库存在。
#异常终止(异常报告为真):
回溯(最近一次呼叫最后一次):
13:from/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:12:in'block(2层)in execute'
.```
我希望它能部署我的应用程序,请问我如何解决这个问题

这是由ssh密钥引起的。请参阅此官方GitHub文档 如果还没有,如何生成一个。如果您已经拥有ssh,请从本地计算机终端添加ssh标识

ssh add~/.ssh/id\u rsa

请注意,这只会为一次部署添加标识,每次重新启动终端或计算机时,您都需要再次添加标识。我不确定您使用的是哪台本地计算机。此堆栈可能有助于永久添加ssh
到您的计算机。

您是否为存储库创建了ssh密钥???这可能会有所帮助: