问题描述
我在Unbuntu 10上安装gitlab-5.0,当我在,它向我显示了下一个冲突:
I am installing gitlab-5.0 on Unbuntu 10, when I execute the 'sudo gem install bundler' command on section Ruby of the gitlab instalation guide, It shows me the next conflict:
root@ubuntu:/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
root@ubuntu:/home/gitlab/gitlab#
然后,在 ...
root@ubuntu:/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
root@ubuntu:/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
我的ruby版本:
My ruby version:
root@ubuntu:/home/gitlab/gitlab# ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
您将如何避免此错误?
推荐答案
s表明你确实没有使用Ruby 2.0来安装你的宝石,而是系统提供的1.8.7。这可能是由于使用 sudo
。
The stack traces indicate that you are indeed not using Ruby 2.0 for installing your gems, but the system-provided 1.8.7. This is probably caused by your use of sudo
.
如果您使用RVM安装了Ruby 2.0.0,你必须使用 rvmsudo
来代替它,它可以确保rvm对 $ PATH
的更改加载特定的红宝石版本将可用于以root身份运行的程序。默认情况下, sudo
会清理 $ PATH
并且会避免更改。
If you have installed your Ruby 2.0.0 using RVM, you have to use rvmsudo
instead which will make sure that the changes rvm does to the $PATH
to load a specific ruby version will be available to the program run as root. By default, sudo
cleans up the $PATH
and will revent the changes.
这篇关于无法安装gitlab-5.0。我无法完成安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!