Install Ruby with RVM on CentOS 2


In the last article, we discussed about Tutorial-Create Hosted Chef Account  

In this post we will install Ruby Version Manager – It is a command line tool that assist in easily installing and managing multiple ruby environments from interpreters to sets of gems.

Create a virtual machine Virtual Box or VMware Workstation.

Install CentOS 6.x in the newly created Virtual machine.

Install Ruby with RVM on CentOS
Open CentOS VM-> Go to terminal
Run curl -L get.rvm.io | bash -s stable
It will give following output:
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc
gpg: Signature made Tue 31 Mar 2015 04:22:13 AM IST using RSA key ID BF04FF17
gpg: Can’t check signature: No public key
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for ‘/usr/local/rvm/archives/rvm-1.26.11.tgz’ – ‘https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc’!
the key can be compared with:
As mentioned in the Output, Run gpg2 –keyserver hkp://keys.gnupg.net –recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 in the terminal
It will give following output:
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpgkeys: key 409B6B1796C275462A1703113804BB82D39DC0E3 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
Run command curl -sSL https://rvm.io/mpapis.asc | gpg2 –import –
It will give following output:
gpg: key D39DC0E3: public key “Michal Papis (RVM signing) <mpapis@gmail.com>” imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
Run command curl -L get.rvm.io | bash -s stable
It will give following output:
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
gpg: Signature made Tue 31 Mar 2015 03:22:13 AM IST using RSA key ID BF04FF17
gpg: Good signature from “Michal Papis (RVM signing) <mpapis@gmail.com>”
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 ‘/usr/local/rvm/archives/rvm-1.26.11.tgz’
Creating group ‘rvm’
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.
# discovertechno,
#
#   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: http://rvm.io/help and https://twitter.com/rvm_io
Now run source /etc/profile.d/rvm.sh
Run command rvm install 2.1.2 in Terminal
It will give following output:
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/x86_64/ruby-2.1.2.
Continuing with compilation. Please read ‘rvm help mount’ to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)…
ruby-2.1.2 – #downloading ruby-2.1.2, 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 11.4M  100 11.4M    0     0   798k      0  0:00:14  0:00:14 –:–:–  271k
ruby-2.1.2 – #extracting ruby-2.1.2 to /usr/local/rvm/src/ruby-2.1.2….
ruby-2.1.2 – #configuring…………………………………………….
ruby-2.1.2 – #post-configuration..
ruby-2.1.2 – #compiling………………………………………………………………………..
ruby-2.1.2 – #installing……………………………
ruby-2.1.2 – #making binaries executable..
ruby-2.1.2 – #downloading rubygems-2.4.8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  437k  100  437k    0     0   172k      0  0:00:02  0:00:02 –:–:–  172k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.2 – #extracting rubygems-2.4.8….
ruby-2.1.2 – #removing old rubygems………
ruby-2.1.2 – #installing rubygems-2.4.8………………….
ruby-2.1.2 – #gemset created /usr/local/rvm/gems/ruby-2.1.2@global
ruby-2.1.2 – #importing gemset /usr/local/rvm/gemsets/global.gems………………………………………..
ruby-2.1.2 – #generating global wrappers……..
ruby-2.1.2 – #gemset created /usr/local/rvm/gems/ruby-2.1.2
ruby-2.1.2 – #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.2 – #generating default wrappers……..
ruby-2.1.2 – #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.2 – #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
Once Ruby is installed successfully Run command rvm use 2.1.2 –default
It will give following output:
Using /usr/local/rvm/gems/ruby-2.1.2
Run command ruby –version
It will give following output:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Install Ruby with RVM on CentOS