To introduce another web application, in this article, we are going to learn you how to install Ruby on CentOS 8. But first, what is ruby? it is a dynamic, multi-purpose, free, and open-source programming language that is usually used for the development of web applications. This high-level programming language helps maintain and continually improve the language for better and more efficient code. You can use it in diverse applications such as data analysis, custom database solutions, and prototyping to mention a few.
How to install Ruby on CentOS 8
Let’s walk through the steps of this guide, to show you How to install Ruby on CentOS 8.
Install Ruby on CentOS 8 via Appstream Repository
You should fire up your terminal and update the system’s packages and repositories, install Ruby using the AppStream repo.
sudo dnf update
And to ensure the below-mentioned packages are installed, use the following command.
sudo dnf install gnupg2 curl tar
Finally, you can install Ruby from the Appstream repositories, by typing:
sudo dnf install @ruby
When you are finished, verify the version of Ruby installed by running the command.
Install Ruby on CentOS 8 using the RVM Manager
RVM, Ruby Version Manager is a versatile command-line tool and package manager, that allows you to install and manage multiple Ruby environments.
First download the RVM startup script as the root user, to install rvm.
Note: to run the following command, you need to switch from the regular to the root user.
curl -sSL https://get.rvm.io | bash
Then, you would recognize that a new group rvm is being installed. As the installer no longer adds users to the rvm group automatically, you will receive its notification, and users need to do this by themselves. So, add the regular user to the rvm group when the installation is finished.
usermod -aG rvm eldernode
Then, run the following command to update the system environment variables.
Next, reload RVM.
You can install package requirements by typing:
When you are sure of the installation success, check the various versions of Ruby that are available for download.
rvm list known
Run the command below, to install Ruby using the RVM manager.
Note: replace the latest version of Ruby with the highlighted below.
rvm install ruby 2.7.1
Try to enjoy this break time, as this will take a while. And then, verify the version of Ruby when the installation is complete.
To reflect the latest version which was installed by the RVM manager, the version of Ruby has changed.
In case you need to make the above version the default for Ruby, you need to run:
rvm use 2.7.1 --default
Good job! You finished the steps of installing Ruby. Also, you can read more to be an expert in CentOS 8.
Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problems in it.