How to install Ruby on CentOS 8?

Windows Articles

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...

How To Install Icinga 2 on Ubuntu 20.04

Today we are going to learn that how to Install Icinga 2 on Ubuntu 20.04. Before going to the installation process let's...
angeloma
angeloma
Senior Writer and partner

Ruby is one of those programming languages that may be a little underestimated. However, it is a robust, multipurpose, open-source language that stands out for its efficiency in coding applications. So, in this post, you will learn how to install Ruby on CentOS 8.

Install Ruby on CentOS using RVM

According to the project’s own website, RVM (Ruby version manager), RVM is a command-line tool that allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. In short, with this tool, you can easily install different versions of Ruby on any system.

By using RVM, you have the main advantage of being able to install the latest stable version of the language. As mentioned earlier, we can install different versions of Ruby.

So, let’s install RVM and then install Ruby.

First, we need to install some pre-installed packages. You can do this with the following command:

:~$ su
:~# dnf install curl gnupg2 tar

You may already have them installed, but it’s better to be safe.

Then, we proceed to download and run the RVM installation script.

:~# curl -sSL https://get.rvm.io | bash
1.- Install RVM on CentOS 8
1.- Install RVM on CentOS 8

The installation should be pretty quick. In the image above we are encouraged to add the users who will be using RVM to the rvm group. In my case, I have only one user and I have added it with the following command

:~# usermod -a -G rvm angelo

Finally, the system environment variables need to be refreshed, so that the ruby variables are added.

:~# source /etc/profile.d/rvm.sh

Now we can use RVM. First of all, we need to install the package requirements that Ruby requires. This is as simple as running the following command:

:~# rvm requirements
2.- Install required packages for ruby
2.- Install required packages for ruby

Then we can check out all the versions of Ruby that we can install with RVM.

:~# rvm list known
3.- Ruby versions
3.- Ruby versions

And finally install the version we want, in this case, I will choose 2.7.0.

:~# rvm install 2.7.0
4.- Install Ruby on CentOS 8
4.- Install Ruby on CentOS 8

To avoid confusion if there are different versions, it is convenient to indicate which one the system will use by default:

:~# rvm use 2.7.0 --default

To check if everything has been successful, just show the current version of ruby

:~# ruby --version

So, that is it. Now you can start working with Ruby.

Conclusion

Ruby is a pretty powerful language. It seems to be given little credit, but it is still widely used and large server applications, as well as scripts, are developed with this language.

Please share this post and join our Telegram channel.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...

How To Install Icinga 2 on Ubuntu 20.04

Today we are going to learn that how to Install Icinga 2 on Ubuntu 20.04. Before going to the installation process let's...