CentOS 8
Sponsored Link

Ruby 2.5 : Install
2019/12/12
 
Install Ruby 2.5.
[1] Make sure the current enabled version of Ruby and Install it.
[root@dlp ~]#
dnf module list ruby

CentOS-8 - AppStream
Name  Stream   Profiles    Summary
ruby  2.5 [d]  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

Dependencies resolved.
================================================================================
 Package           Arch   Version                               Repository
                                                                           Size
================================================================================
Installing group/module packages:
 ruby              x86_64 2.5.3-104.module_el8.0.0+179+565e49e2 AppStream  86 k
Installing dependencies:
 ruby-irb          noarch 2.5.3-104.module_el8.0.0+179+565e49e2 AppStream 101 k
 ruby-libs         x86_64 2.5.3-104.module_el8.0.0+179+565e49e2 AppStream 2.9 M
 rubygem-json      x86_64 2.1.0-104.module_el8.0.0+179+565e49e2 AppStream  90 k
 rubygem-psych     x86_64 3.0.2-104.module_el8.0.0+179+565e49e2 AppStream  94 k
Installing weak dependencies:
 rubygem-bigdecimal
                   x86_64 1.3.4-104.module_el8.0.0+179+565e49e2 AppStream  96 k
 rubygem-did_you_mean
                   noarch 1.2.0-104.module_el8.0.0+179+565e49e2 AppStream  89 k
 rubygem-io-console
                   x86_64 0.4.6-104.module_el8.0.0+179+565e49e2 AppStream  66 k
 rubygem-openssl   x86_64 2.1.2-104.module_el8.0.0+179+565e49e2 AppStream 189 k
 rubygem-rdoc      noarch 6.0.1-104.module_el8.0.0+179+565e49e2 AppStream 486 k
 rubygems          noarch 2.7.6-104.module_el8.0.0+179+565e49e2 AppStream 308 k
Installing module profiles:
 ruby/common
Enabling module streams:
 ruby                     2.5

Transaction Summary
================================================================================
Install  11 Packages
.....
.....

[root@dlp ~]#
ruby -v

ruby 2.5.3p105 (2018-10-18 revision 65156) [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)
EOF 

[root@dlp ~]#
ruby ruby_test.rb

Hello Ruby World !
Matched Content