【发布时间】:2014-01-29 11:43:20
【问题描述】:
我正在尝试将 capistrano 从 v2 升级到 v3。我的部署在这里失败
我的 git 路径是
$ 哪个 git
/usr/bin/git
$ /usr/bin/env git --version
git 版本 1.8.5.2
$ cap development deploy:check
INFO [bc6a1c31] Running /usr/bin/env mkdir -p /tmp/my_app_name/ on 40.17.329.77
DEBUG [bc6a1c31] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -p /tmp/my_app_name/ )
INFO [bc6a1c31] Finished in 4.281 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/my_app_name/git-ssh.sh 0.0%
INFO Uploading /tmp/my_app_name/git-ssh.sh 100.0%
INFO [63f3b4b8] Running /usr/bin/env chmod +x /tmp/my_app_name/git-ssh.sh on 40.17.329.77
DEBUG [63f3b4b8] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env chmod +x /tmp/my_app_name/git-ssh.sh )
INFO [63f3b4b8] Finished in 0.627 seconds with exit status 0 (successful).
DEBUG [f2bd4b22] Running /usr/bin/env git ls-remote git@github.com:example/webapp.giton 40.17.329.77
DEBUG [f2bd4b22] Command: ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/my_app_name/git-ssh.sh /usr/bin/env git ls-remote git@github.com:example/webapp.git)
DEBUG [f2bd4b22] /usr/bin/env:
DEBUG [f2bd4b22] git
DEBUG [f2bd4b22] : No such file or directory
DEBUG [f2bd4b22]
DEBUG [f2bd4b22] Finished in 0.627 seconds with exit status 127 (failed).
【问题讨论】:
-
看起来你远程机器上的 git 可执行文件不在你的 PATH 中。确保 git 在您用于远程部署的用户的系统 PATH 变量中。例如,在远程计算机用户的 .bashrc 中,您可以添加如下内容:
export PATH=$PATH:/usr/<path where you git executable is> -
@ Rico - 我的应用程序路径中有 git。我已经在使用 capistrano 2 来部署相同的应用程序。它接受我的 git 路径。通过它我可以完成所有操作(git pull,push)。但是为什么我的 git 路径不被 capistrano 3 接受用于同一个应用程序?
-
你可以通过 ssh 访问删除电脑吗?
-
你能从远程机器上的命令行运行
/usr/bin/env git吗?另外,你能把/usr/bin/env的输出贴到远程机器上吗? -
@ Rico - 谢谢。 Git 不在远程机器上。非常感谢。请将此作为答案发布。我会接受的。
标签: ruby-on-rails ruby-on-rails-3 git amazon-web-services amazon-ec2