Skip to content

Instantly share code, notes, and snippets.

@aleksb86
Created August 15, 2017 06:25
Show Gist options
  • Save aleksb86/dd6ebe25c74cc4ac649b1ea8a914fc78 to your computer and use it in GitHub Desktop.
Save aleksb86/dd6ebe25c74cc4ac649b1ea8a914fc78 to your computer and use it in GitHub Desktop.
Install RVM, Ruby, gems (Rails, etc.)
1. INSTALL RVM:
aboev@aboev-Vostro-5568:/$ cd /tmp
aboev@aboev-Vostro-5568:/tmp$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: keyring `/home/aboev/.gnupg/secring.gpg' created
gpg: keyring `/home/aboev/.gnupg/pubring.gpg' created
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: requesting key 39499BDB from hkp server keys.gnupg.net
gpg: /home/aboev/.gnupg/trustdb.gpg: trustdb created
gpg: key D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported
gpg: key 39499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg: imported: 2 (RSA: 2)
aboev@aboev-Vostro-5568:/tmp$ curl -sSL https://get.rvm.io -o rvm.sh
The program 'curl' is currently not installed. You can install it by typing:
sudo apt install curl
install curl:
aboev@aboev-Vostro-5568:/tmp$ sudo apt-get update
[sudo] password for aboev:
Hit:1 http://ru.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://ru.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://ru.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://archive.canonical.com/ubuntu xenial InRelease
Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Ign:6 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://dl.google.com/linux/chrome/deb stable Release
Get:8 https://repo.skype.com/deb stable InRelease [4 487 B]
Get:10 https://repo.skype.com/deb stable/main amd64 Packages [1 416 B]
Fetched 108 kB in 0s (116 kB/s)
Reading package lists... Done
aboev@aboev-Vostro-5568:/tmp$ sudo apt-get install curl
2. GET RVM INSTALLER SCRIPT:
aboev@aboev-Vostro-5568:/tmp$ curl -sSL https://get.rvm.io -o rvm.sh
aboev@aboev-Vostro-5568:/tmp$ ls
config-err-QlcRUh
rvm.sh
3. START INSTALL RVM:
aboev@aboev-Vostro-5568:/tmp$ cat ./rvm.sh | bash -s stable --rails
Downloading https://github.com/rvm/rvm/archive/1.29.2.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.2/1.29.2.tar.gz.asc
gpg: Signature made Чт 22 июн 2017 19:18:38 MSK using RSA key ID BF04FF17
gpg: Good signature from "Michal Papis (RVM signing) <mpapis@gmail.com>" [unknown]
gpg: aka "Michal Papis <michal.papis@toptal.com>" [unknown]
gpg: aka "[jpeg image of size 5015]" [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: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
GPG verified '/home/aboev/.rvm/archives/rvm-1.29.2.tgz'
Installing RVM to /home/aboev/.rvm/
Adding rvm PATH line to /home/aboev/.profile /home/aboev/.mkshrc /home/aboev/.bashrc /home/aboev/.zshrc.
Adding rvm loading line to /home/aboev/.profile /home/aboev/.bash_profile /home/aboev/.zlogin.
Installation of RVM in /home/aboev/.rvm/ is almost complete:
* To start using RVM you need to run `source /home/aboev/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# aboev,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: https://rvm.io/help and https://twitter.com/rvm_io
bash: line 880: __rvm_print_headline: command not found
4. GET AVAILABLE RUBY VERSIONS:
aboev@aboev-Vostro-5568:~$ rvm list known
# 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[.6]
[ruby-]2.3[.3]
[ruby-]2.4[.0]
ruby-head
# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2
# JRuby
jruby-1.6[.8]
jruby-1.7[.26]
jruby[-9.1.7.0]
jruby-head
# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx[-3.71]
rbx-head
# Opal
opal
# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1[.2.0]
mruby[-head]
# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]
# Topaz
topaz
# MagLev
maglev[-head]
maglev-1.0.0
# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head
# IronRuby
ironruby[-1.1.3]
ironruby-head
5. INSTALL RUBY IN RVM:
aboev@aboev-Vostro-5568:~$ rvm install ruby-2.4
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.4.0.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system....
Installing required packages: gawk, libssl-dev, zlib1g-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgmp-dev, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev, libgmp-dev, libreadline6-dev................
Requirements installation successful.
ruby-2.4.0 - #configure
ruby-2.4.0 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16.4M 100 16.4M 0 0 399k 0 0:00:42 0:00:42 --:--:-- 332k
ruby-2.4.0 - #validate archive
ruby-2.4.0 - #extract
ruby-2.4.0 - #validate binary
ruby-2.4.0 - #setup
ruby-2.4.0 - #gemset created /home/aboev/.rvm/gems/ruby-2.4.0@global
ruby-2.4.0 - #importing gemset /home/aboev/.rvm/gemsets/global.gems......................
ruby-2.4.0 - #generating global wrappers........
ruby-2.4.0 - #gemset created /home/aboev/.rvm/gems/ruby-2.4.0
ruby-2.4.0 - #importing gemsetfile /home/aboev/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.0 - #generating default wrappers........
6. CREATE GEMSET (RUBY + ANY GEMS):
aboev@aboev-Vostro-5568:~$ rvm use 2.4@rails-5.1.3 --create
ruby-2.4.0 - #gemset created /home/aboev/.rvm/gems/ruby-2.4.0@rails-5.1.3
ruby-2.4.0 - #generating rails-5.1.3 wrappers..........
Using /home/aboev/.rvm/gems/ruby-2.4.0 with gemset rails-5.1.3
7. install rails (it installs in current gemset, if gemset used):
aboev@aboev-Vostro-5568:~$ gem install rails -v 5.1.3
Fetching: i18n-0.8.6.gem (100%)
Successfully installed i18n-0.8.6
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.3.gem (100%)
Parsing documentation for bundler-1.15.3
Installing ri documentation for bundler-1.15.3
.............too many strings with dependencies
Parsing documentation for sprockets-3.7.1
Installing ri documentation for sprockets-3.7.1
Parsing documentation for sprockets-rails-3.2.0
Installing ri documentation for sprockets-rails-3.2.0
Parsing documentation for rails-5.1.3
Installing ri documentation for rails-5.1.3
Done installing documentation for i18n, thread_safe, tzinfo, concurrent-ruby, activesupport, rack, rack-test, mini_portile2, nokogiri, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, arel, activerecord, globalid, activejob, mime-types-data, mime-types, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, thor, method_source, railties, bundler, sprockets, sprockets-rails, rails after 52 seconds
36 gems installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment