Content on this page is probably outdated and represents my personal knowledge, feelings and understading of things at that time.
So, you installed your GitLab instance as I
described in my previous blog post
but now you can’t update to GitLab 7.1 because it officially requires “latest
stable Ruby” which is not packaged for Debian Wheezy.
Warning: Using this method you will not be
able to copy and paste the commands from the Upgrade docs anymore, but it’s
still preatty straightforward if you know basics of Linux systems.
root # cd /home/git
root # su git
git # \curl -sSL https://get.rvm.io -o rvm-installer
git # cat rvm-installer
git # bash < ./rvm-install
git # source /home/git/.rvm/scripts/rvm
git # rvm autolibs disable
This installs the latest stable RVM version. Now we’ll install the latest ruby
version.
git # rvm list known
lists all the available ruby versions, look for the latest stable release (in
our case that’s ruby-2.1.2). Let’s install it:
git # rvm install 2.1.2
git # rvm use 2.1.2
Now you have to check if some Ruby requirements are not met with:
git # rvm requirements
If some are not met (there were none on my setup), install them with apt-get after getting out of git user:
git # exit
root # apt-get install …
root # su git
Looks like Debian and RVM need a fix to play nicely together, namely add:
[[ -s “$HOME/.rvm/scripts/rvm” ]] && . “$HOME/.rvm/scripts/rvm”
to the end off (/home/git/.bashrc), exit and su back and now everything should
be ok. You can check with:
git # ruby –version
That’s it, now off to actual GitLab stuff.
root # service gitlab stop
root # su git
git # cd /home/git/gitlab
git # bundle install --without development test postgres --deployment
Now you can start GitLab and check the ruby version in /admin
git # exit
root # service gitlab start
If everything went as planned, GitLab reports the installed Ruby version
correctly.
There's one unfortune consequence of using RVM as single user install. Namely
sudo by default doesen't source .bashrc and therefore the standard commands in
GitLab upgrade docs fail. One solution is to simply su to git user and just
execute commands there (the ones previously executed with sudo).root # su git
git # cd /home/git/gitlab
git # git stash
git # git checkout 7-0-stable
git # cd /home/git/gitlab-shell
git # git fetch
git # git checkout v1.9.6
git # cd /home/git/gitlab
git # bundle install --without development test postgres --deployment
git # bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
git # git diff origin/6-9-stable:config/gitlab.yml.example origin/7-0-stable:config/gitlab.yml.example
git # exit
root # cp /home/git/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab
root # chmod +x /etc/init.d/gitlab
root # service gitlab start
root # service nginx restart
For further upgrades I used the GitLab
Upgrader. That I run manually when logged in as git user.
root # su git
git # cd /home/git/gitlab
git # ruby bin/upgrade.rb