CentOS Stream 10

Ruby 4.0 : Install2026/04/22

 

Install Ruby.

[1] Install Ruby 4.0 and try to run test script.
[root@dlp ~]#
dnf -y install ruby4.0

Dependencies resolved.
================================================================================================================================
 Package                     Architecture               Version                             Repository                     Size
================================================================================================================================
Installing:
 ruby4.0                     x86_64                     4.0.1-33.el10                       appstream                     8.4 M

Transaction Summary
================================================================================================================================
Install  1 Package
.....
.....

[root@dlp ~]#
ruby4.0 -v

ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [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 ~]#
ruby4.0 ruby_test.rb

Hello Ruby World !
Matched Content