Ruby is an open-source and high-level programming language used for developing dynamic and modern web applications. Additionally, Ruby is also used for scripting, data analysis, static site generation and a whole lot more.
Ruby is behind the popular and powerful Ruby and rails framework, upon which many popular websites such as twitter, airbnb, github have been built.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Open Source Software Installation on Ubuntu Linux system.
In this context, we shall look into the Installation procedure of the Ruby programming language on CentOS 8.
1. Ruby Installation from CentOS 8 repositories
To begin, we need to update our system's packages and repositories by running the following dnf command:
$ sudo dnf update
Some dependencies are also required for Ruby's installation to proceed smoothly.
$ sudo dnf install tar curl gnupg2
With the prerequisites installed, proceed and install Ruby from the CentOS 8 AppStream repositories using the dnf package manager
$ sudo dnf install @ruby
Next, confirm the Ruby version installed as follows:
$ ruby --version
2. Ruby Installation on centOS using RVM
Ruby Version Manager(RVM) is a command-line utility that allows you to easily manage, install and run multiple Ruby environments. To install the latest version of RVM, run the following curl command as a root user:
$ curl -sSL https://get.rvm.io | bash
During the installation, you will be provided with a source command followed by the path to rvm, use this command to start RVM. In our case, we execute the below command:
$ source /home/winnie/ .rvm/scripts/rvm
Next, install ruby package requirements:
$ rvm requirements
Now that ruby package requirements are successfully installed, let's check the versions of Ruby that are available for download. Execute the command:
$ rvm list known
Next, we will install the latest version of Ruby which is 3.0.2. To do this, simply run the below RVM command
$ rvm install ruby 3.0.2
Finally, to verify the version of Ruby installed in our machine, execute the command:
$ ruby --version
To make the recently installed version the default Ruby version on your system, simply run the below command:
$ rvm use 2.7.1 --default
[Need assistance in Installing Ruby on your Linux System ? We can help you. ]
This article covers steps to Install Ruby and run ruby applications on your centos 8 machine. In fact, Ruby is a dynamic, object-oriented programming language focused on simplicity and productivity. RVM (Ruby Version Manager) is a tool for installing and managing multiple Ruby versions on single operating systems.
To Verify Active Ruby Version installed on your Linux system, run the below command:
$ ruby --version