{% comment %}
Copyright (C) The Arvados Authors. All rights reserved.

SPDX-License-Identifier: CC-BY-SA-3.0
{% endcomment %}

Ruby 2.5 or newer is required.

* "Option 1: Install from packages":#packages
* "Option 2: Install with RVM":#rvm
* "Option 3: Install from source":#fromsource

h2(#packages). Option 1: Install from packages

{% include 'notebox_begin' %}
Future versions of Arvados may require a newer version of Ruby than is packaged with your OS.  Using OS packages simplifies initial install, but may complicate upgrades that rely on a newer Ruby.  If this is a concern, we recommend using "RVM":#rvm.
{% include 'notebox_end' %}

h3. Centos 7

The Ruby version shipped with Centos 7 is too old.  Use "RVM":#rvm to install Ruby 2.5 or later.

h3. Debian and Ubuntu

Debian 9 (stretch) and Ubuntu 16.04 (xenial) ship Ruby 2.3, which is not supported by Arvados.  Use "RVM":#rvm to install Ruby 2.5 or later.

Debian 10 (buster) and Ubuntu 18.04 (bionic) and later ship with Ruby 2.5, which is supported by Arvados.

<notextile>
<pre><code># <span class="userinput">apt-get --no-install-recommends install ruby ruby-dev bundler</span></code></pre>
</notextile>

h2(#rvm). Option 2: Install with RVM

h3. Install gpg and curl

h4. Centos 7

<pre>
yum install gpg curl which
</pre>

h4. Debian and Ubuntu

<pre>
apt-get --no-install-recommends install gpg curl
</pre>

h3. Install RVM

<notextile>
<pre><code># <span class="userinput">gpg --keyserver pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.5
</span></code></pre></notextile>

To use Ruby installed from RVM, load it in an open shell like this:

<notextile>
<pre><code><span class="userinput">. /usr/local/rvm/scripts/rvm
</span></code></pre></notextile>

Alternately you can use @rvm-exec@ (the first parameter is the ruby version to use, or "default"), for example:

<notextile>
<pre><code><span class="userinput">rvm-exec default rails console
</span></code></pre></notextile>

Finally, install Bundler:

<notextile>
<pre><code>~$ <span class="userinput">gem install bundler</span>
</code></pre></notextile>

h2(#fromsource). Option 3: Install from source

Install prerequisites for Debian 8:

<notextile>
<pre><code><span class="userinput">sudo apt-get install \
    bison build-essential gettext libcurl3 libcurl3-gnutls \
    libcurl4-openssl-dev libpcre3-dev libreadline-dev \
    libssl-dev libxslt1.1 zlib1g-dev
</span></code></pre></notextile>

Install prerequisites for CentOS 7:

<notextile>
<pre><code><span class="userinput">sudo yum install \
    libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel \
    patch readline-devel zlib-devel libffi-devel openssl-devel \
    make automake libtool bison sqlite-devel tar
</span></code></pre></notextile>

Install prerequisites for Ubuntu 12.04 or 14.04:

<notextile>
<pre><code><span class="userinput">sudo apt-get install \
    gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev \
    libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev \
    libncurses5-dev automake libtool bison pkg-config libffi-dev curl
</span></code></pre></notextile>

Build and install Ruby:

<notextile>
<pre><code><span class="userinput">mkdir -p ~/src
cd ~/src
curl -f http://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.5.tar.gz | tar xz
cd ruby-2.5.5
./configure --disable-install-rdoc
make
sudo make install

sudo -i gem install bundler</span>
</code></pre></notextile>