Commit b65129b685f333e4341d5d083ea561bcb57c1b68
1 parent
66a5f753
Exists in
master
and in
4 other branches
Add Ruby upgrade instructions
Showing
1 changed file
with
53 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,53 @@ |
| 1 | +# Updating Ruby from source | |
| 2 | + | |
| 3 | +This guide explains how to update Ruby in case you installed it from source according to the instructions in https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md#2-ruby . | |
| 4 | + | |
| 5 | +### 1. Look for Ruby versions | |
| 6 | +This guide will only update `/usr/local/bin/ruby`. You can see which Ruby binaries are installed on your system by running: | |
| 7 | + | |
| 8 | +```bash | |
| 9 | +ls -l $(which -a ruby) | |
| 10 | +``` | |
| 11 | + | |
| 12 | +### 2. Stop GitLab | |
| 13 | + | |
| 14 | +```bash | |
| 15 | +sudo service gitlab stop | |
| 16 | +``` | |
| 17 | + | |
| 18 | +### 3. Install or update dependencies | |
| 19 | +Here we are assuming you are using Debian/Ubuntu. | |
| 20 | + | |
| 21 | +```bash | |
| 22 | +sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl | |
| 23 | +``` | |
| 24 | + | |
| 25 | +### 4. Download, compile and install Ruby | |
| 26 | +Pick a Ruby version at https://www.ruby-lang.org/en/downloads/ . Here we use Ruby 2.0.0p353, 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 | +```bash | |
| 29 | +cd /tmp | |
| 30 | +curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz | |
| 31 | +cd ruby-2.0.0-p353 | |
| 32 | +./configure --disable-install-rdoc | |
| 33 | +make | |
| 34 | +sudo make install # overwrite the existing Ruby in /usr/local/bin | |
| 35 | +``` | |
| 36 | + | |
| 37 | +### 5. Reinstall GitLab gem bundle | |
| 38 | +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://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md#install-gems). | |
| 39 | + | |
| 40 | +```bash | |
| 41 | +cd /home/git/gitlab | |
| 42 | +sudo -u git -H rm -rf vendor/bundle # remove existing Gem bundle | |
| 43 | +sudo -u git -H bundle install --deployment --without development test postgres aws # Assuming MySQL | |
| 44 | +``` | |
| 45 | + | |
| 46 | +### 6. Start GitLab | |
| 47 | +We are now ready to restart GitLab. | |
| 48 | + | |
| 49 | +```bash | |
| 50 | +sudo service gitlab start | |
| 51 | +``` | |
| 52 | + | |
| 53 | +### Done | ... | ... |