安装gitlib的报错常见问题记录

##问题一

env | grep -E "^(GEM_HOME|PATH|RUBY_VERSION|MY_RUBY_HOME|GEM_PATH)=" > ~/.ssh/environment

这一行如果没有执行会报

[~/projects] $ ssh -T git@192.168.33.10
/home/git/gitlab-shell/bin/gitlab-shell:8: undefined method `require_relative' for main:Object (NoMethodError)

##问题二

bundle exec rake gitlab:check RAILS_ENV=production

....
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... no
  Try fixing it:
  Update your git to a version >= 1.7.10 from 1.7.9
  Please fix the error above and rerun the checks.

Checking GitLab ... Finished

安装新版的git

$ which git
/usr/bin/git

cd
mkdir local
cd local
git clone git://github.com/git/git.git

cd git
git tag
git checkout v1.8.3
make prefix=/usr all
sudo make prefix=/usr install
注:安装的时候prefix=/usr,最终会自动变成/usr/bin/路径的

或者 Update: I found a ppa to keep git updated:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

... ...

继续补充

ref:http://sysblog.sund.org/2013/05/rake-gitlabcheck-complains-about-git-version/

Comments