Install Ruby on Rocky Linux

Contents
Enable EPEL
Install Ruby with dnf
ruby -v
Notes on newer versions

Enable EPEL

Rocky Linux keeps the base system lean and ships many developer tools through EPEL, the Extra Packages for Enterprise Linux collection.

Enable EPEL once with dnf before you install Ruby. After that step the package manager can find Ruby and its dependencies without extra setup.

Install Ruby with dnf

With the repositories ready, one dnf command installs Ruby for the whole system:

Install Ruby

sudo dnf install ruby

Confirm the install when dnf shows the package summary. It adds the ruby and gem commands so every new terminal can use them right away.

ruby -v

Check what was installed with one short command:

Show the installed Ruby version

ruby -v

ruby 3.0.4 (2022-04-12 revision 6787cd5c8f) [x86_64-linux]

You will see the word ruby followed by the version number and build details. If the terminal reports that the command was not found, repeat the dnf step above.

Notes on newer versions

Enterprise distributions favor stability over freshness, so the packaged Ruby may lag behind the newest release. That is expected and it is fine for this course.

When a project later requires a newer Ruby, use a version manager such as rbenv or a container image. Those options live beside the system Ruby and leave the base system untouched.

Next: Install Ruby on macOS

Article author: Arthur Isaev

Related articles
Ruby
Ruby course: zero to hero in 50 lessons
What is Ruby and where it runs
Install Ruby and check the version
irb: the interactive shell
Your first Ruby script
Variables
Numbers
Strings
Symbols
Truthiness: only false and nil
Conditions
Loops
Arrays
Hashes
Ranges
Methods
Blocks, procs, lambdas
String tools
Files and IO
Exceptions
Modules and mixins
Classes and objects
Inheritance
Enumerables
Duck typing and core idioms
Gems and Bundler
Testing with Minitest
Debugging
Encodings
Time and date
JSON and YAML
HTTP clients
Sockets
REST APIs
puts, print and p
Metaprogramming
Enumerators
Pattern matching
Arguments: splats and kwargs
Rake tasks
Environment and CLI
Logging
CSV
ERB templates
WEBrick server
Rails in one lesson
Capstone: todo CLI
Capstone: JSON API
Performance
Modern Ruby tour
Hero roadmap: the whole course on one page
Install Ruby on Windows 11
Install Ruby on Ubuntu
Install Ruby on Rocky Linux
Install Ruby on macOS
Install Ruby on FreeBSD
Ruby in Docker
Threads and fibers
Banner image

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: