Nitrous.io: Deploying with capistrano results in "ERROR: Repository not found" despite being able to view remote, push/pull, etc

Nitrous.io: Deploying with capistrano results in "ERROR: Repository not found" despite being able to view remote, push/pull, etc

我正在设置一个 Nitrous.io 框,无法使用 capistrano 将我的代码从 github 部署到登台服务器。远程已设置,我已将 nitrous public ssh 密钥添加到服务器(我可以从 Nitrous 终端 ssh 进入)和我的 github 帐户,但是当我尝试部署时我得到:

The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host http01-staging.myapp.com: git exit status: 1                                  
git stdout: Nothing written                                                                                                                                                            
git stderr: Error reading response length from authentication socket.                                                                                                                  
ERROR: Repository not found.                                                                                                                                                           
fatal: Could not read from remote repository.                                                                                                                                          

Please make sure you have the correct access rights                                                                                                                                    
and the repository exists.                                                                                                                                                             
error: Could not fetch origin 

存储库当然存在,我已经用这个 Nitrous 盒子成功地推送和拉取了分支 to/from。我在这里遗漏了什么吗?

答案是我必须 运行 从 Nitrous.io 终端执行以下命令:

eval `ssh-agent`
ssh-add

不确定为什么我能够在不执行此操作的情况下完成其他操作(ssh 进入服务器,将 from/push 拉至 GitHub)。

您可以为此使用 capistrano-ssh-doctor 插件,以及所有类似的 capistrano ssh 相关问题和故障排除。

示例问题:ssh 无密码登录、本地 ssh-agent 运行、添加到本地 ssh-agent 的密钥、ssh-agent 转发等

插件 "analyzes" 您的 capistrano 配置以及与远程服务器的连接,并为您提供 "report" 可能出错的地方,或者只是说明一切正常。

免责声明:插件是我写的。