当远程git在非标准路径上时使用capistrano [英] Using capistrano when remote git is on a non-standard path
问题描述
我的共享主机没有提供git,所以我建立并安装到〜/ bin。
当我运行它,我得到以下错误在大多数命令,虽然它们是成功的。
My shared host did not provide git, so I built and installed it into ~/bin. When I ran it, I got the following error on most commands, although they were successful.
stdin:不是tty
我可以通过添加来解决这个问题:
I can solve that problem by adding:
default_run_options [:pty] = true
到我的deploy.rb,但是我收到这个错误,阻止部署:
to my deploy.rb, but then I get this error, which blocks deployment:
sh:git:command not found
我如何解决这两个错误?
How can I resolve both errors?
我尝试添加一个〜/ .ssh /环境文件与PATH = $ PATH:$ HOME / bin
(并更改sshd_config使用它),但它什么也没有。
I tried adding a ~/.ssh/environment file with "PATH=$PATH:$HOME/bin"
(and changing sshd_config to use it) but it did nothing.
看起来,capistrano正在使用的shell是不在远程服务器上使用〜/ .bashrc或〜/ .bash_profile。
It seems whatever shell is being used by capistrano is not using the ~/.bashrc or ~/.bash_profile on the remote server.
任何想法如何在远程机器上设置路径?
Any ideas how to set the path on the remote machine?
其他信息:我在本地使用OS X,共享服务器是Site5上的linux。
other info: I'm using OS X locally, and the shared server is linux on Site5.
推荐答案
Th ks Chu,你把我放在正确的道路上。
Thanks, Chu - you put me on the right path.
只需使用: set:scm_command,〜/ bin / git
still给我错误,因为我的本地git不在那个地方。
just using: set :scm_command, "~/bin/git"
still gave me errors, since my local git is not in that place.
但是,以下内容似乎有效,并解决了我的问题:
set:scm_command,〜/ bin / git
set:local_scm_command,/ usr / local / bin / git
However, the following seems to work, and to solve my issues:
set :scm_command, "~/bin/git"
set :local_scm_command, "/usr/local/bin/git"
这篇关于当远程git在非标准路径上时使用capistrano的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!