Ruby 2.3.3 Released – Install Ruby 2.3.3 on CentOS/RHEL, This is an upgrade of Ruby 2.3 series. 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 tutorial will help you to install Ruby 2.3.3 on CentOS, RedHat systems using RVM.
Step 1. Install Dependencies
First of all, we need to install all required packages for ruby installation on our system using the following command.
installgcc-c++ patch readline readline-devel zlib zlib-devel # yum installlibyaml-devel libffi-devel openssl-devel make # yum installbzip2 autoconf automake libtool bison iconv-devel sqlite-devel
Step 2. Install RVM
Install the latest stable version of RVM on your system using the following command. This command will automatically download all required files and install on your system.
# curl -sSL https://rvm.io/mpapis.asc | gpg --import - # curl -L
get.rvm.io| bash -s stable
Also, run below command to load rvm environment.
# source /etc/profile.d/rvm.sh # rvm reload
Step 3. Verify Dependencies
Now use following command to verify all dependencies are properly installed.
rvm requirements runChecking requirements for centos. Requirements installation successful.
Step 4. Install Ruby 2.3
After completing setup of RVM environment lets install Ruby language using the following command.
# rvm install
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.3.3.tar.bz2 Checking requirements for ubuntu. Requirements installation successful. ruby-2.3.3 - #configure ruby-2.3.3 - #download % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 24.8M 100 24.8M 0 0 818k 0 0:00:31 0:00:31 --:--:-- 899k ruby-2.3.3 - #validate archive ruby-2.3.3 - #extract ruby-2.3.3 - #validate binary ruby-2.3.3 - #setup ruby-2.3.3 - #gemset created /usr/local/rvm/gems/[email protected] ruby-2.3.3 - #importing gemset /usr/local/rvm/gemsets/global.gems.............................. ruby-2.3.3 - #generating global wrappers........ ruby-2.3.3 - #gemset created /usr/local/rvm/gems/ruby-2.3.3 ruby-2.3.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list ruby-2.3.3 - #generating default wrappers........
Step 5. Setup Default Ruby Version
First of all, check currently installed ruby versions on your system.
rvm listrvm rubies * ruby-2.3.0 [ x86_64 ] => ruby-2.3.3 [ x86_64 ] # => - current # =* - current && default # * - default
After that use rvm command to setup default ruby version to be used by applications.
rvm use 2.3.3 --defaultUsing /usr/local/rvm/gems/ruby-2.3.3
Step 6. Check Current Ruby Version.
Using following command you can check the current ruby version is used.
ruby --versionruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Congratulation’s, Finally you have successfully installed Ruby on your system. Read our next article to integrate Ruby with Apache web server with easy steps.