2

我在服务器端设置了一个空的 git repo,一切都设置好了。

Cap deploy:setup 执行此操作

    [109.etc] env RAILS_ENV=production sh -c 'git clone git@109.etc:srv/paintings.git /srv/paintings/current'
 ** [out :: 109.etc] Initialized empty Git repository in /srv/paintings/current/.git/
 ** [out :: 109.etc] The authenticity of host '109.etc (109.etc)' can't be established.
 ** [out :: 109.etc] RSA key fingerprint is e9:af:d6:d3:0e:f5:de:a3:4a:31:6e:8e:4a:c7:b7:ee.
 ** [out :: 109.etc] Are you sure you want to continue connecting (yes/no)?

*当我输入 yes 或 y 时,它只是“挂起”似乎什么都没有发生... * 在 cap deploy:setup 之后已经尝试过 --debug 可能有什么问题?

4

1 回答 1

2

Capistrano 本质上是非交互式的。如果弹出这样的提示,不幸的是,您不能只告诉它“是”,因为您输入的命令不会发送到远程主机。您必须手动执行“是”。

要解决此问题,请将主机的密钥添加到该用户的 known_hosts 文件中。因此,SSH 进入任何正在执行部署的机器,su 进入该用户,然后尝试 SSH 进入109.etc. 您将收到相同的警告提示,并且可以在其中输入“是”,这一次它会起作用。之后,cap deploy按照正常情况,您将不再收到此消息。

于 2012-03-15T15:44:27.150 回答