17574: Merge branch 'main'
[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.5 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. Centos 7
20
21 The Ruby version shipped with Centos 7 is too old.  Use "RVM":#rvm to install Ruby 2.5 or later.
22
23 h3. Debian and Ubuntu
24
25 Debian 10 (buster) and Ubuntu 18.04 (bionic) and later ship with Ruby 2.5, which is supported by Arvados.
26
27 <notextile>
28 <pre><code># <span class="userinput">apt-get --no-install-recommends install ruby ruby-dev bundler</span></code></pre>
29 </notextile>
30
31 h2(#rvm). Option 2: Install with RVM
32
33 h3. Install gpg and curl
34
35 h4. Centos 7
36
37 <pre>
38 yum install gpg curl which
39 </pre>
40
41 h4. Debian and Ubuntu
42
43 <pre>
44 apt-get --no-install-recommends install gpg curl
45 </pre>
46
47 h3. Install RVM
48
49 <notextile>
50 <pre><code># <span class="userinput">gpg --keyserver pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
51 \curl -sSL https://get.rvm.io | bash -s stable --ruby=2.5
52 </span></code></pre></notextile>
53
54 To use Ruby installed from RVM, load it in an open shell like this:
55
56 <notextile>
57 <pre><code><span class="userinput">. /usr/local/rvm/scripts/rvm
58 </span></code></pre></notextile>
59
60 Alternately you can use @rvm-exec@ (the first parameter is the ruby version to use, or "default"), for example:
61
62 <notextile>
63 <pre><code><span class="userinput">rvm-exec default rails console
64 </span></code></pre></notextile>
65
66 Finally, install Bundler:
67
68 <notextile>
69 <pre><code>~$ <span class="userinput">gem install bundler</span>
70 </code></pre></notextile>
71
72 h2(#fromsource). Option 3: Install from source
73
74 Install prerequisites for Debian 10:
75
76 <notextile>
77 <pre><code><span class="userinput">sudo apt-get install \
78     bison build-essential gettext libcurl4 \
79     libcurl4-openssl-dev libpcre3-dev libreadline-dev \
80     libssl-dev libxslt1.1 zlib1g-dev
81 </span></code></pre></notextile>
82
83 Install prerequisites for CentOS 7:
84
85 <notextile>
86 <pre><code><span class="userinput">sudo yum install \
87     libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel \
88     patch readline-devel zlib-devel libffi-devel openssl-devel \
89     make automake libtool bison sqlite-devel tar
90 </span></code></pre></notextile>
91
92 Install prerequisites for Ubuntu 16.04:
93
94 <notextile>
95 <pre><code><span class="userinput">sudo apt-get install \
96     bison build-essential gettext libcurl3 \
97     libcurl3-openssl-dev libpcre3-dev libreadline-dev \
98     libssl-dev libxslt1.1 zlib1g-dev
99 </span></code></pre></notextile>
100
101 Build and install Ruby:
102
103 <notextile>
104 <pre><code><span class="userinput">mkdir -p ~/src
105 cd ~/src
106 curl -f http://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.5.tar.gz | tar xz
107 cd ruby-2.5.5
108 ./configure --disable-install-rdoc
109 make
110 sudo make install
111
112 sudo -i gem install bundler</span>
113 </code></pre></notextile>