How To Install ruby on CentOS 8

ruby is An interpreter of object-oriented scripting language An interpreter of object-oriented scripting language

Introduction

In this tutorial we learn how to install ruby on CentOS 8.

What is ruby

Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible. ruby 2.5.9 107.module_el8.4.0+847+ee687b6c x86_64 87 k ruby-2.5.9-107.module_el8.4.0+847+ee687b6c.src.rpm appstream An interpreter of object-oriented scripting language http (Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible.

We can use yum or dnf to install ruby on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install ruby.

Install ruby on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ruby using dnf by running the following command:

sudo dnf -y install ruby

Install ruby on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ruby using yum by running the following command:

sudo yum -y install ruby

How To Uninstall ruby on CentOS 8

To uninstall only the ruby package we can use the following command:

sudo dnf remove ruby

ruby Package Contents on CentOS 8

/usr/bin/erb
/usr/bin/ruby
/usr/lib/.build-id
/usr/lib/.build-id/53
/usr/lib/.build-id/53/ccb693ab4946d8e95c843d215ed08a55d01968
/usr/share/licenses/ruby
/usr/share/licenses/ruby/BSDL
/usr/share/licenses/ruby/COPYING
/usr/share/licenses/ruby/COPYING.ja
/usr/share/licenses/ruby/GPL
/usr/share/licenses/ruby/LEGAL
/usr/share/man/man1/erb.1.gz
/usr/share/man/man1/ruby.1.gz
/usr/bin/erb
/usr/bin/ruby
/usr/lib/.build-id
/usr/lib/.build-id/5e
/usr/lib/.build-id/5e/4c7d54cf302ee82aace93c2173498e78e4238e
/usr/share/licenses/ruby
/usr/share/licenses/ruby/BSDL
/usr/share/licenses/ruby/COPYING
/usr/share/licenses/ruby/COPYING.ja
/usr/share/licenses/ruby/GPL
/usr/share/licenses/ruby/LEGAL
/usr/share/man/man1/erb.1.gz
/usr/share/man/man1/ruby.1.gz
/usr/bin/erb
/usr/bin/ruby
/usr/lib/.build-id
/usr/lib/.build-id/5e
/usr/lib/.build-id/5e/68795182422d53e324c4470331098ffd0fbb6c
/usr/share/licenses/ruby
/usr/share/licenses/ruby/BSDL
/usr/share/licenses/ruby/COPYING
/usr/share/licenses/ruby/COPYING.ja
/usr/share/licenses/ruby/GPL
/usr/share/licenses/ruby/LEGAL
/usr/share/man/man1/erb.1.gz
/usr/share/man/man1/ruby.1.gz
/usr/bin/erb
/usr/bin/ruby
/usr/lib/.build-id
/usr/lib/.build-id/b1
/usr/lib/.build-id/b1/1e483184f5ac7cab7b4ec8b9ab893943ac22c7
/usr/share/licenses/ruby
/usr/share/licenses/ruby/BSDL
/usr/share/licenses/ruby/COPYING
/usr/share/licenses/ruby/COPYING.ja
/usr/share/licenses/ruby/GPL
/usr/share/licenses/ruby/LEGAL
/usr/share/man/man1/erb.1.gz
/usr/share/man/man1/ruby.1.gz

References

Summary

In this tutorial we learn how to install ruby on CentOS 8 using yum and dnf.