If you want to develop ruby application using some ruby frameworks like Ruby on Rails, Padrino, etc., on Amazon Linux 2 you will have to install ruby as a dependency. This topic will help you to install Ruby on Amazon Linux 2.
Prerequisites
- Amazon Linux 2
- sudo privileges
Install Ruby on Amazon Linux 2
Step 1. First, let’s find the latest stable Ruby version.
sudo amazon-linux-extras list | grep ruby
Output:
39 ruby2.6 available [ =2.6 =stable ]
57 ruby3.0 available [ =stable ]
Step 2. To install the latest stable version, run:
sudo amazon-linux-extras install ruby3.0
Step 3. Verify version.
ruby -v
Output:
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
Conclusion
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.