Install Ruby
Environment
- Debian 9.7 x64
rvm
1.29.8ruby
2.6.3
Excerpt https://rvm.io/
Log 2019 / 05
1. Install rvm
root@athos:~# apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade
root@athos:~# apt-get -y --no-install-recommends install curl gnupg2 dirmngr
apt-get -y --no-install-recommends install patch gawk g++ gcc \
libssl-dev make libc6-dev patch zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 \
autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config \
libffi-dev libgmp-dev libreadline-dev
root@athos:~# apt-get -y --no-install-recommends install patch gawk g++ gcc \
> libssl-dev make libc6-dev patch zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 \
> autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config \
> libffi-dev libgmp-dev libreadline-dev
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
root@athos:~# gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
> 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: key 105BD0E739499BDB: 6 signatures not checked due to missing keys
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 105BD0E739499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>"
imported
gpg: key 3804BB82D39DC0E3: 105 signatures not checked due to missing keys
gpg: key 3804BB82D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>"
imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg: imported: 2
root@athos:~# \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.8.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.8/1.29.8.tar.gz.asc
gpg: Signature made Wed 08 May 2019 02:14:49 PM UTC
gpg: using RSA key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB
GPG verified '/usr/local/rvm/archives/rvm-1.29.8.tgz'
Creating group 'rvm'
sent invalidate(passwd) request, exiting
sent invalidate(group) request, exiting
sent invalidate(group) request, exiting
Installing RVM to /usr/local/rvm/
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with
`umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
* Please do NOT forget to add your users to the rvm group.
The installer no longer auto-adds root or users to the rvm group. Admins must
do this. Also, please note that group memberships are ONLY evaluated at login time.
This means that users must log out then back in before group membership takes effect!
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
root@athos:~# source /etc/profile.d/rvm.sh
root@athos:~# rvm version
rvm 1.29.8 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
2. Install ruby
root@athos:~# rvm list known | head -15
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.6]
[ruby-]2.5[.5]
[ruby-]2.6[.3]
ruby-head
root@athos:~# rvm install ruby --latest
Searching for binary rubies, this might take some time.
No binary rubies available for: debian/9/x86_64/ruby-2.6.3.
Continuing with compilation.
Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for debian.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.6.3, this may take
a while depending on your cpu(s)...
ruby-2.6.3 - #downloading ruby-2.6.3, this may take
a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.8M 100 13.8M 0 0 16.6M 0 --:--:-- --:--:-- --:--:-- 16.6M
ruby-2.6.3 - #extracting ruby-2.6.3 to /usr/local/rvm/src/ruby-2.6.3.....
ruby-2.6.3 - #configuring.......................................................
ruby-2.6.3 - #post-configuration..
ruby-2.6.3 - #compiling.........................................................
ruby-2.6.3 - #installing...............
ruby-2.6.3 - #making binaries executable..
Rubygems 3.0.3 already available in installed ruby, skipping installation,
use --force to reinstall.
ruby-2.6.3 - #gemset created /usr/local/rvm/gems/ruby-2.6.3@global
ruby-2.6.3 - #importing gemset /usr/local/rvm/gemsets/global.gems...............
ruby-2.6.3 - #generating global wrappers.......
ruby-2.6.3 - #gemset created /usr/local/rvm/gems/ruby-2.6.3
ruby-2.6.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated
to empty gem list
ruby-2.6.3 - #generating default wrappers.......
ruby-2.6.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.6.3 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
root@athos:~# rvm install 2.5.5
(truncated)
root@athos:~# rvm list rubies
=> ruby-2.5.5 [ x86_64 ]
* ruby-2.6.3 [ x86_64 ]
# => - current
# =* - current && default
# * - default
root@athos:~# rvm --default use 2.6.3
Using /usr/local/rvm/gems/ruby-2.6.3
3. Hello, World!
root@athos:~# ruby -e "puts 'Hello, World! '"
Hello, World!