我正在尝试使用Capistrano部署项目.我的开发机器正在运行Windows 7; 我正在部署的服务器是Linux.
在deploy.rb脚本中,设置以下内容:
ssh_options[:forward_agent] = true
Run Code Online (Sandbox Code Playgroud)
Capistrano脚本从本地运行git命令开始,此时我被提示输入SSH密钥的密码:
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:pathto/gitproject.git develop"
Enter passphrase for key '/c/Users/Sam/.ssh/id_rsa':
command finished in 6999ms
Run Code Online (Sandbox Code Playgroud)
(我可能已经从中看到了真正的git路径.)
我输入我的密码,这很好用.然而,Capistrano然后尝试在远程机器上做类似的事情(在下面重命名为staging-server.com)并且我得到一个错误 - 请参阅此提取的最后一行:
[staging-server.com] executing command
[staging-server.com] sh -c 'git clone git@github.com:pathto/gitproject.git /home/perstest/releases/20120412074500 && cd
/home/perstest/releases/20120412074500 && git checkout -b deploy 50eaf06d06d66fd20c3e55038276f420d8c308a8 && (echo 50eaf06d06d66fd20c3e55038
276f420d8c308a8 > /home/perstest/releases/20120412074500/REVISION)'
** [staging-server.com :: out] Initialized empty Git repository in /home/perstest/releases/20120412074500/.git/
** [staging-server.com :: err] Error reading response length from authentication socket.
Run Code Online (Sandbox Code Playgroud)
如果我在deploy.rb中注释掉forward_agent行,则此安装成功,可能是使用部署服务器本身的密钥.
我的SSH密钥似乎正在工作 - 毕竟,最初的git命令工作,我可以在git …