CentOS Stream 8
Sponsored Link

Ruby 2.5 : Install
Install Ruby 2.5.
[1] Confirm the current enabled version of Ruby and Install 2.5.
[root@dlp ~]#
dnf module list ruby

CentOS Stream 8 - AppStream
Name  Stream   Profiles    Summary
ruby  2.5 [d]  common [d]  An interpreter of object-oriented scripting language
ruby  2.6      common [d]  An interpreter of object-oriented scripting language
ruby  2.7      common [d]  An interpreter of object-oriented scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# install Ruby 2.5

[root@dlp ~]#
dnf module -y install ruby:2.5/common

Dependencies resolved.
 Package                Arch    Version                                 Repo        Size
Installing group/module packages:
 ruby                   x86_64  2.5.5-105.module_el8.1.0+214+9be47fd7   appstream   86 k
Installing dependencies:
 ruby-irb               noarch  2.5.5-105.module_el8.1.0+214+9be47fd7   appstream  102 k
 ruby-libs              x86_64  2.5.5-105.module_el8.1.0+214+9be47fd7   appstream  2.9 M
 rubygem-json           x86_64  2.1.0-105.module_el8.1.0+214+9be47fd7   appstream   90 k
 rubygem-openssl        x86_64  2.1.2-105.module_el8.1.0+214+9be47fd7   appstream  190 k
 rubygem-psych          x86_64  3.0.2-105.module_el8.1.0+214+9be47fd7   appstream   95 k
Installing weak dependencies:
 rubygem-bigdecimal     x86_64  1.3.4-105.module_el8.1.0+214+9be47fd7   appstream   97 k
 rubygem-did_you_mean   noarch  1.2.0-105.module_el8.1.0+214+9be47fd7   appstream   90 k
 rubygem-io-console     x86_64  0.4.6-105.module_el8.1.0+214+9be47fd7   appstream   66 k
 rubygem-rdoc           noarch  6.0.1-105.module_el8.1.0+214+9be47fd7   appstream  486 k
 rubygems               noarch appstream  308 k
Installing module profiles:
Enabling module streams:
 ruby                           2.5

Transaction Summary
Install  11 Packages

[root@dlp ~]#
ruby -v

ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

# verify to create test script

[root@dlp ~]# cat > ruby_test.rb <<'EOF' 
msg = Class.send(:new, String);
mymsg = msg.send(:new, "Hello Ruby World !\n");
STDOUT.send(:write, mymsg)

[root@dlp ~]#
ruby ruby_test.rb

Hello Ruby World !
Matched Content