Merge branch '20497-updating-wgs-tutorial'
[arvados.git] / doc / _includes / _install_ruby_and_bundler.liquid
1 {% comment %}
2 Copyright (C) The Arvados Authors. All rights reserved.
3
4 SPDX-License-Identifier: CC-BY-SA-3.0
5 {% endcomment %}
6
7 Ruby 2.6 or newer is required.
8
9 * "Option 1: Install from packages":#packages
10 * "Option 2: Install with RVM":#rvm
11 * "Option 3: Install from source":#fromsource
12
13 h2(#packages). Option 1: Install from packages
14
15 {% include 'notebox_begin' %}
16 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.
17 {% include 'notebox_end' %}
18
19 h3. Alma/CentOS/Red Hat/Rocky
20
21 The Ruby version shipped with version 7 of these distributions is too old.  Use "RVM":#rvm to install a newer version of Ruby (we recommend installing version 2.7 or newer).
22
23 Ruby 2.7 is available in a module with version 8 of these distributions. You can install it by running:
24
25 <notextile>
26 <pre><code># <span class="userinput">dnf module enable ruby:2.7</span>
27 # <span class="userinput">dnf install --enablerepo=devel ruby ruby-devel</span></code></pre>
28 </notextile>
29
30 h3. Debian and Ubuntu
31
32 Debian 10 (buster) and Ubuntu 18.04 (bionic) ship with Ruby 2.5, which is too old for Arvados. Use "RVM":#rvm to install a newer version of Ruby (we recommend installing version 2.7 or newer).
33
34 Debian 11 (bullseye) and Ubuntu 20.04 (focal) and later ship with Ruby 2.7 or newer, which is sufficient for Arvados.
35
36 <notextile>
37 <pre><code># <span class="userinput">apt-get --no-install-recommends install ruby ruby-dev</span></code></pre>
38 </notextile>
39
40 h2(#rvm). Option 2: Install with RVM
41
42 h3. Install gpg and curl
43
44 h4. Alma/CentOS/Red Hat/Rocky
45
46 <pre>
47 dnf install gpg curl which
48 </pre>
49
50 h4. Debian and Ubuntu
51
52 <pre>
53 apt-get --no-install-recommends install gpg curl
54 </pre>
55
56 h3. Install RVM, Ruby and Bundler
57
58 <notextile>
59 <pre><code># <span class="userinput">gpg --keyserver pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
60 \curl -sSL https://get.rvm.io | bash -s stable --ruby=2.7
61 </span></code></pre></notextile>
62
63 This command installs the latest Ruby 2.7.x release, as well as the @gem@ and @bundle@ commands.
64
65 To use Ruby installed from RVM, load it in an open shell like this:
66
67 <notextile>
68 <pre><code><span class="userinput">source /usr/local/rvm/scripts/rvm
69 </span></code></pre></notextile>
70
71 Alternately you can use @rvm-exec@ (the first parameter is the ruby version to use, or "default"), for example:
72
73 <notextile>
74 <pre><code><span class="userinput">rvm-exec default ruby -v
75 </span></code></pre></notextile>
76
77 h2(#fromsource). Option 3: Install from source
78
79 Install prerequisites for Debian 10, Ubuntu 18.04 and Ubuntu 20.04:
80
81 <notextile>
82 <pre><code><span class="userinput">sudo apt-get install \
83     bison build-essential gettext libcurl4 \
84     libcurl4-openssl-dev libpcre3-dev libreadline-dev \
85     libssl-dev libxslt1.1 zlib1g-dev
86 </span></code></pre></notextile>
87
88 Install prerequisites for Alma/CentOS/Red Hat/Rocky:
89
90 <notextile>
91 <pre><code><span class="userinput">sudo dnf install \
92     libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel \
93     patch readline-devel zlib-devel libffi-devel openssl-devel \
94     make automake libtool bison sqlite-devel tar
95 </span></code></pre></notextile>
96
97 Build and install Ruby:
98
99 <notextile>
100 <pre><code><span class="userinput">mkdir -p ~/src
101 cd ~/src
102 curl -f https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.gz | tar xz
103 cd ruby-2.7.5
104 ./configure --disable-install-rdoc
105 make
106 sudo make install
107
108 # Make sure the post install script can find the gem and ruby executables
109 sudo ln -s /usr/local/bin/gem /usr/bin/gem
110 sudo ln -s /usr/local/bin/ruby /usr/bin/ruby
111 # Install bundler
112 sudo -i gem install bundler</span>
113 </code></pre></notextile>