2013-03-23 34 views
2

我对Unbuntu 10安装gitlab-5.0的安装,当我执行的gitlab安装目录指南section Ruby“sudo的创业板安装捆绑”命令,它让我看到未来的冲突:无法安装gitlab-5.0。我不能完成

[email protected]:/home/gitlab/gitlab# sudo gem install bundler 
Successfully installed bundler-1.3.4 
Installing ri documentation for bundler-1.3.4 
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block 
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block 
Done installing documentation for bundler after 8 seconds 
1 gem installed 
[email protected]:/home/gitlab/gitlab# 

然后,在section Gems ...

[email protected]:/home/gitlab/gitlab# sudo gem install charlock_holmes --version '0.6.9' 
Building native extensions. This could take a while... 
Successfully installed charlock_holmes-0.6.9 
Installing ri documentation for charlock_holmes-0.6.9 
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block 
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block 
Done installing documentation for charlock_holmes after 0 seconds 
1 gem installed 

[email protected]:/home/gitlab/gitlab# sudo -u git -H bundle install --deployment --without development test postgres 
Gemfile syntax error: 
/home/gitlab/gitlab/Gemfile:14: syntax error, unexpected ':', expecting $end 
gem "mysql2", group: :mysql 

我的红宝石版本:

[email protected]:/home/gitlab/gitlab# ruby -v 
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] 

如何Y就应该你避免这个错误?

回答

3

堆栈跟踪表明您确实没有使用Ruby 2.0来安装您的宝石,而是系统提供的1.8.7。这可能是由于您使用了sudo

如果您已经使用RVM安装你的Ruby 2.0.0,你必须使用rvmsudo代替,这将确保该改变RVM确实给$PATH装载特定的红宝石版本将提供给root身份运行该程序。默认情况下,sudo清理了$PATH并将避免更改。

1

还有一个fewissues与红宝石2.0,我仍然会建议1.9.3现在。

但确保没有其他红宝石安装在你的ruby 2.0旁边,当然不是红宝石1.8,就像在issue 2285中一样。

1

我发现rvm和gitlab不能很好地结合在一起,除非你真的需要在你的服务器上轻松地支持多个版本的ruby,只需root安装ruby。

主要的问题是,gitlab安装经常使用sudo,但root没有与gitlab用户相同的路径。这对于rvm来说并不是一条快乐的路径,因为它最好作为单个用户安装进行安装,即使为多用户正确安装,对路径更改也非常敏感。