I am installing gitlab-5.0 on Ubuntu 10, when I execute the 'sudo gem install bundler' command on section Ruby of the gitlab installation 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#
Then, on the section Gems...
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
My ruby version:
root@ubuntu:/home/gitlab/gitlab# ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
How would you avoid this error?
There are still a few issues with ruby 2.0, I would still recommend 1.9.3 for now.
But make sure no other ruby is installed beside your ruby 2.0, certainly not a ruby 1.8, like in issue 2285.
I have found that rvm and gitlab don't play very nicely together and unless you have a real need to easily support multiple versions of ruby on your server, just root install ruby.
The primary problem is that the gitlab install frequently makes use of sudo, but root doesn't have the same path as the gitlab user. This is not a happy path for rvm as it is best installed as a single user install, and is very sensitive to path changes even when installed correctly for a multi-user.
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
.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.