2013-03-23 98 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來說並不是一條快樂的路徑,因爲它最好作爲單個用戶安裝進行安裝,即使爲多用戶正確安裝,對路徑更改也非常敏感。