2013-11-25 07:55:09 -05:00
# Updating Ruby from source
2014-05-12 08:00:04 -04:00
This guide explains how to update Ruby in case you installed it from source according to the [instructions ](../install/installation.md#2-ruby ).
2013-11-25 07:55:09 -05:00
2014-04-24 18:48:22 -04:00
## 1. Look for Ruby versions
2013-11-25 07:55:09 -05:00
This guide will only update `/usr/local/bin/ruby` . You can see which Ruby binaries are installed on your system by running:
```bash
ls -l $(which -a ruby)
```
2014-04-24 18:48:22 -04:00
## 2. Stop GitLab
2013-11-25 07:55:09 -05:00
```bash
sudo service gitlab stop
```
2014-04-24 18:48:22 -04:00
## 3. Install or update dependencies
2013-11-25 07:55:09 -05:00
Here we are assuming you are using Debian/Ubuntu.
```bash
sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl
```
2014-04-24 18:48:22 -04:00
## 4. Download, compile and install Ruby
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 ](https://www.ruby-lang.org/en/news/2013/11/22/heap-overflow-in-floating-point-parsing-cve-2013-4164/ ).
2013-11-25 07:55:09 -05:00
```bash
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
2013-11-29 15:43:40 -05:00
sudo gem install bundler
2013-11-25 07:55:09 -05:00
```
### 5. Reinstall GitLab gem bundle
2014-04-24 18:48:22 -04:00
2014-05-12 08:00:04 -04:00
Just to be sure we will reinstall the gems used by GitLab. Note that the `bundle install` command [depends on your choice of database ](../install/installation.md#install-gems ).
2013-11-25 07:55:09 -05:00
```bash
cd /home/git/gitlab
sudo -u git -H rm -rf vendor/bundle # remove existing Gem bundle
2014-03-03 19:40:30 -05:00
sudo -u git -H bundle install --deployment --without development test mysql aws # Assuming PostgreSQL
2013-11-25 07:55:09 -05:00
```
2014-04-24 18:48:22 -04:00
## 6. Start GitLab
2013-11-25 07:55:09 -05:00
We are now ready to restart GitLab.
```bash
sudo service gitlab start
```
2014-04-24 18:48:22 -04:00
## Done