Using gitlab with RVM
Created by: WilHall
For anyone having trouble using gitlab with an RVM installation of Ruby, it is easy to do using wrappers:
Create a wrapper for the bundle command and RVM ruby you want:
wil@wilhall:/home/git/gitlab$ which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby
wil@wilhall:/home/git/gitlab$ rvm wrapper ruby-1.9.3-p448 ext_1.9.3 bundle
Saving wrappers to '/usr/local/rvm/bin'.
wil@wilhall:/home/git/gitlab$ ls /usr/local/rvm/bin/ext_1.9.3_bundle
/usr/local/rvm/bin/ext_1.9.3_bundle
Once you have created the wrapper, simply replace the bundle
command anywhere you see it in the gitlab installation guide with your wrapper /usr/local/rvm/bin/ext_1.9.3_bundle
.
Make sure to also replace the bundle
command inside the provided init.d script. I usually do this by creating a variable for the bundle path:
BUNDLE=/usr/local/rvm/bin/ext_1.9.3_bundle
And using it throughout the script. (Example: http://wilhall.com/static/gitlab)
If you perform setup and launch (via init.d) of gitlab using a bundle, you can target any specific RVM install and not have to worry about changing the active version via `rvm use`` - GitLab will always run under the same version of ruby.