Install Ruby 2.6- CentOS 7.6

Ruby language is open source, it is simple and focuses on productivity while at the same time has an elegant syntax that is easy to read and understand.

We’ll be installing the latest version released in April 2019, version 2.6.

We’ll begin with a fresh CentOS 7.6 minimal installation.

Start off by first installing the “Development Tools” group

yum groupinstall "Development Tools"

Just to cover our bases, install the epel repo

yum install epel-release

Now for the dependencies

yum install readline-devel zlib-devel libffi-devel libyaml-devel openssl-devel sqlite-devel

Note: there are other dependencies but they’ve been covered when we installed the “Development Tools” group.

Next, we need to install RVMRVM lets you install and manage multiple ruby environments. Install by issuing the following

gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

curl -sSL | bash -s stable --ruby

To set up the environment

source /etc/profile.d/
rvm reload

Install any dependencies not covered by the steps above

rvm requirements run

To list the available versions of Ruby we can install, issue the following at the shell

rvm list known

At the time of writing, Ruby 2.6 is the latest version

# MRI Rubies
[ruby-]1.8.7[-head] # security released on head

Install Ruby version 2.6

rvm install 2.6

If you want this version to be the default version, then do the following:

rvm use 2.6 --default

That’s it you’re done.

Last Updated: May 2, 2019 @ 11:24 pm