ruby,

How to Install Ruby on Amazon Linux 2

Mar 16, 2022 · 1 min read · Post a comment
How to Install Ruby on Amazon Linux 2

If you want to develop ruby application using some ruby frameworks like ruby on rails, padrino … 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 access

Install Ruby on Amazon Linux 2

Step 1. First, let’s find the ruby latest stable version.

sudo amazon-linux-extras list | grep ruby

Example 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 the version.

ruby -v

Example 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.