This guide explains how to update Ruby in case you installed it from source according to the instructions.
This guide will only update /usr/local/bin/ruby
. You can see which Ruby binaries are installed on your system by running:
ls -l $(which -a ruby)
sudo service gitlab stop
Here we are assuming you are using Debian/Ubuntu.
sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl
Find the latest stable version of Ruby 1.9 or 2.0 at https://www.ruby-lang.org/en/downloads/ . We recommend at least 2.0.0-p353, which is patched against CVE-2013-4164.
cd /tmp
curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz
cd ruby-2.0.0-p353
./configure --disable-install-rdoc
make
sudo make install # overwrite the existing Ruby in /usr/local/bin
sudo gem install bundler
Just to be sure we will reinstall the gems used by GitLab. Note that the bundle install
command depends on your choice of database.
cd /home/git/gitlab
sudo -u git -H rm -rf vendor/bundle # remove existing Gem bundle
sudo -u git -H bundle install --deployment --without development test mysql aws # Assuming PostgreSQL
We are now ready to restart GitLab.
sudo service gitlab start