How to Install Ruby 2.2.4 on CentOS/RHEL with RVM

Ruby 2.2.4 is a dynamic, object-oriented programming language.We are using RVM, which stands for Ruby Version Manager. RVM is a command-line tool which allows you to easily install, manage and work with multiple ruby version of Ruby without conflicting. Also as per our requirement, we can switch the Ruby version very easily.

Ruby 2.2.4

See Also:
1. How To Deploy a Rails Application with Apache using Phusion Passenger
2. How To Install Apache Maven on Ubuntu 16.04 and 14.04
3. Install Apache Maven on CentOS 7/6/5
4. Install LAMP (Apache 2.4, MySQL 5.6, and PHP 7.0) on Ubuntu using PPA
5. Install LAMP (Apache 2.4, MySQL 5.6, and PHP 7.0) on CentOS/RHEL 7
6. How to Install Ruby 2.3.3 on CentOS/RHEL with RVM
7. How to Install Ruby 2.4.0 on CentOS/RHEL with RVM
8. How To Install Ruby on Rails on Ubuntu using RVM

This article we will explain you to How to Install Ruby 2.2.4 on CentOS/RHEL using RVM.

Step 1: Install Required Packages

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

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

Step 2: Install RVM

Now install latest version of RVM on your system using following command.

# curl -sSL https://rvm.io/mpapis.asc | gpg --import -
# curl -L get.rvm.io | bash -s stable

Now use below command to setup rvm environment.

# source /etc/profile.d/rvm.sh
# rvm reload

Step 3: Verify Dependencies

Now use following command to verify all dependencies are installed or not.

# rvm requirements run
Checking requirements for centos.
Requirements installation successful.

Step 4: Install Ruby 2.2.4

Now, lets install Ruby language using following command.

# rvm install 2.2.4

Step 5: Setup Default Ruby Version

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

# rvm use 2.2.4 --default
Using /usr/local/rvm/gems/ruby-2.2.4

Step 6: Verify Ruby Version

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

# ruby --version
ruby 2.2.4p230 (2015-12-16 revision 53155) [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

Enjoy it!

No Responses

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.