• Home
  • Ubuntu 16.04
    • Whats New ?
    • Install JAVA 8
    • Setup LAMP Stack
    • Install LEMP Stack
    • Install Node.js
    • Install Git
    • Move Unity Launcher to Bottom
  • FeedBack
  • Funny Tools
  • Tutorials
    • Linux Distributions
      • CentOS
      • Debian
      • Fedora
      • LinuxMint
    • Monitoring Tools
      • Monit
      • Nagios
      • NRPE
    • Network Services
      • DHCP
      • DNS
      • FTP
    • Databases
      • MySQL
      • MariaDB
      • MongoDB
      • PostgreSQL
      • SQL Server
    • Amazon Web Services
  • Submit Article
  • About Us
TecAdmin.net
  • Home
  • Ubuntu 16.04
    • Whats New ?
    • Install JAVA 8
    • Setup LAMP Stack
    • Install LEMP Stack
    • Install Node.js
    • Install Git
    • Move Unity Launcher to Bottom
  • FeedBack
  • Funny Tools
  • Tutorials
    • Linux Distributions
      • CentOS
      • Debian
      • Fedora
      • LinuxMint
    • Monitoring Tools
      • Monit
      • Nagios
      • NRPE
    • Network Services
      • DHCP
      • DNS
      • FTP
    • Databases
      • MySQL
      • MariaDB
      • MongoDB
      • PostgreSQL
      • SQL Server
    • Amazon Web Services
  • Submit Article
  • About Us
14 December 2015

How to Install Ruby 2.1.8 on CentOS & RHEL using RVM

Written by Rahul K. | December 14, 2015
Ruby ruby, ruby 2.1, ruby 2.10, ruby-lang, rvm
Warning – Ruby 2.1 is reached to end of life and no more maintained. Kindly use below tutorials to install latest version of ruby

  • Current stable – Install Ruby Latest Stable Release
  • Previous stable – Install Ruby Previous Stable Release

Ruby is a dynamic, object-oriented programming language.We are using RVM, which stands for Ruby Version Manager, which makes easier to install Ruby on Linux platform. RVM is also helpful for managing multiple version of Ruby without conflicting, and we can switch system to any version of Ruby using a single command.

This article will helps you to How to Install Ruby 2.1.8 on CentOS, RedHat Systems using RVM. To install other releases of Ruby use following links

Step 1: Install Required Packages

Firstly we need to install all required packages for ruby installation on our system using following command.

# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
Step 2: Install RVM

Install latest stable version of RVM on your system using following command. This command will automatically download all required files and install on your system.

# curl -L get.rvm.io | bash -s stable
Step 3: Setup RVM Environment

RVM provides a shell script to setup system environment before installing Ruby. Use below command to setup rvm environment.

# source /etc/profile.d/rvm.sh
Step 4: Install Ruby

After completing setup of RVM environment, lets install Ruby language using following command.

# rvm install 2.1.8

[Sample Output]

Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-2.1.8.
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.8, this may take a while depending on your cpu(s)...
ruby-2.1.8 - #downloading ruby-2.1.8, 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  33.5M      0 --:--:-- --:--:-- --:--:-- 33.6M
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.8 - #extracting ruby-2.1.8 to /usr/local/rvm/src/ruby-2.1.8....
ruby-2.1.8 - #configuring.....................................................
ruby-2.1.8 - #post-configuration..
ruby-2.1.8 - #compiling.........................................................................................................
ruby-2.1.8 - #installing.................................
ruby-2.1.8 - #making binaries executable..
ruby-2.1.8 - #downloading rubygems-2.4.8
ruby-2.1.8 - #extracting rubygems-2.4.8.....
ruby-2.1.8 - #removing old rubygems.........
ruby-2.1.8 - #installing rubygems-2.4.8......................
ruby-2.1.8 - #gemset created /usr/local/rvm/gems/[email protected]
ruby-2.1.8 - #importing gemset /usr/local/rvm/gemsets/global.gems...............................................
ruby-2.1.8 - #generating global wrappers........
ruby-2.1.8 - #gemset created /usr/local/rvm/gems/ruby-2.1.8
ruby-2.1.8 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.8 - #generating default wrappers........
ruby-2.1.8 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.8 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
Step 5: Setup Default Ruby Version

Use rvm command to setup default ruby version to be used by applications.

# rvm use 2.1.8 --default

Using /usr/local/rvm/gems/ruby-2.1.8
Step 6: Check Current Ruby Version.

Using following command you can check the current ruby version is used.

# ruby --version

ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]

Congratulation’s you have successfully install Ruby on your system. Read our next article to integrate Ruby with Apache web server with easy steps.

References:
1. http://rvm.io/rubies/installing

Share it!
Share on Facebook
Share on Twitter
Share on Google+
Share on Reddit
Share on Tumblr
Rahul K.
Rahul K.
Connect on Facebook Connect on Twitter Connect on Google+

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Related Posts

  • How to Deploy Ruby App with Nginx and Passenger on Ubuntu and Debian

  • How to Deploy Ruby App with Apache and Passenger on Ubuntu and Debian

  • How to Install Ruby 2.4 on CentOS/RHEL 7/6, Fedora 27/26

  • How to Install Ruby 2.3 on CentOS/RHEL 7/6, Fedora 27/26 with RVM

  • How to Install Ruby 2.2.4 on CentOS/RHEL with RVM

10 Comments

  1. webdoanhnhan.com
    July 4, 2013 at 2:49 am

    Thаnks for ones mаrvelous ρosting!
    I really enjoyed reading it, you could be a great аuthor.
    I will make certain to booκmark your blog аnd will often come back in the foresеeable future.

    I want tо еncourage youгself to сontinue youг great woгk, hаve а nice weekend!

  2. louis vuitton online store
    June 21, 2013 at 2:07 pm

    Oh my goodness! a tremendous article dude.

  3. how-to-build-a-wordpress-website.webnode.com
    June 19, 2013 at 11:42 pm

    Thanks for any оther informatiνe blog.
    Тhe ρlacе else may Ӏ am gettіng that type of
    infoгmatiоn written іn such аn ideаl way?
    I’ve a project that I am just now operating on, and I’νe
    been on the glаncе out foг such infοrmation.

  4. pure green coffee bean extract 800mg
    June 15, 2013 at 1:11 pm

    Thаnκ уοu, I hаvе just been
    seаrсhіng for іnfοгmation about thіѕ topic for a lоng time аnԁ
    yours is the bеѕt I’ve came upon till now. But, what about the conclusion? Are you certain in regards to the source?

  5. light up hoodie
    June 11, 2013 at 11:25 pm

    Hurгah, that’s what I was exploring for, what a data! present here at this blog, thanks admin of this web page.

  6. Monte
    June 11, 2013 at 9:43 pm

    I am really glad to glance at this website posts ωhich
    contains plentу of useful information, thanks for providing thеse information.

  7. guaranteedgreencoffee.com.wenotify.net
    June 11, 2013 at 9:29 pm

    Magnifiсent items frоm you, man.
    I’ve consider your stuff prior to and you are just too wonderful. I actually like what you’ѵe bought here, cеrtainly likе what you’re stating and the way in which by which you assert it. You’гe
    making it enteгtaining and you still tаkе саrе
    of to keep it smart. I can not wait to lеarn
    much more frоm you. Thіs iѕ rеаllу а gгeat site.

  8. Pablo
    June 11, 2013 at 6:28 pm

    I couldn’t refrain from commenting. Perfectly written!

  9. raspberry ketones supplement
    June 11, 2013 at 6:18 pm

    Vегy niсe аrtiсlе, just ωhat I was loоking
    fοг.

  10. Alexander Wang outlet
    May 28, 2013 at 1:17 pm

    This really answered my drawback, thanks!

Popular Posts

  • How to Install JAVA 8 on Ubuntu 18.04/16.04, LinuxMint 18/17
  • How to Install s3cmd in Linux and Manage Amazon s3 Buckets
  • How to Install AnyDesk on Ubuntu, Debian and LinuxMint (Alternative of TeamViewer)
  • How to Setup Selenium with ChromeDriver on Ubuntu 16.04
  • How to Install MySQL on macOS Sierra and High Sierra
All rights reserved. © 2013-2018 TecAdmin.net. This site uses cookies. By using this website you agree our term and services