ruby.md 1.81 KB
Newer Older
1 2
# Updating Ruby from source

3
This guide explains how to update Ruby in case you installed it from source according to the instructions in https://gitlab.com/gitlab-org/gitlab-ce/blob/masterdoc/install/installation.md#2-ruby .
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

### 1. Look for Ruby versions
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)
```

### 2. Stop GitLab

```bash
sudo service gitlab stop
```

### 3. Install or update dependencies
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
```

### 4. Download, compile and install Ruby
Philippe Lafoucrière's avatar
Philippe Lafoucrière committed
26
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/).
27 28 29 30 31 32 33 34

```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
Tandrial's avatar
Tandrial committed
35
sudo gem install bundler
36 37 38
```

### 5. Reinstall GitLab gem bundle
39
Just to be sure we will reinstall the gems used by GitLab. Note that the `bundle install` command [depends on your choice of database](https://gitlab.com/gitlab-org/gitlab-ce/blob/masterdoc/install/installation.md#install-gems).
40 41 42 43

```bash
cd /home/git/gitlab
sudo -u git -H rm -rf vendor/bundle  # remove existing Gem bundle
44
sudo -u git -H bundle install --deployment --without development test mysql aws # Assuming PostgreSQL
45 46 47 48 49 50 51 52 53 54
```

### 6. Start GitLab
We are now ready to restart GitLab.

```bash
sudo service gitlab start
```

### Done