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