Step 1 – Prerequsities

First of all, install all the required packages for the Ruby installation on your CentOS 8 system. Use the following command to install the required packages:

Step 2 – Install RVM

We can install RVM using a shell script provided by the core team. Now, install the latest stable version of RVM on your system using the following commands. Before installing packages import GPG key on your machine. After that install the latest stable RVM version on your system using the following command: Once the installation finished, run below command to load the RVM environment.

Step 3 – Verify Dependencies

Verify that all the dependencies are properly installed on your system using the below command. If any missing dependency found the script will automatically install it on your system.

Step 4 – Install Ruby on CentOS 8

Your CentOS 8 machine is ready for the Ruby installation. Find out the available Ruby version for installation using the below command. Then install the required Ruby version on your system. Here, I am installing Ruby 2.6 on my CentOS 8 system. You can simply replace the version to below command of your choice and install.

Step 5 – Setup Default Ruby Version

First of all, check the currently installed ruby versions on your system. So that we can find which version is using currently by the system and which is set to default. If you have multiple versions of ruby, use the below command to set up the default ruby version to be used by applications.

Step 6 – Verify Active Ruby Version

Using the following command you can check the currently active ruby version. Congratulation’s, Finally you have successfully installed Ruby on your system. Read our next articles to deploy Ruby with Apache or Ruby with Nginx web server with simple steps. References: 1.