This article will provide you with different methods to install Ruby on Ubuntu 22.04.
There are three methods to install Ruby on Ubuntu 22.04 which are as following:
Rbnev is a command-line utility that allows you to install the latest version of Ruby
The following steps are required to install Ruby on Ubuntu 22.04 successfully.
Step 1: First update the Ubuntu apt package system using the following command:
Step 2: Next, install required dependencies and libraries for Ruby using the following command:
Step 3: Next, run the shell script file using the below-mentioned command:
Step 4: To start using Rbnev, you will need to update the path environment using the following shell script command:
Step 5: Once Rbnev installation is completed, you can then list the Ruby version using the following command.
Step 6: Now, use the following command to install the latest version of Ruby on Ubuntu:
Step 7: To set the installed version of Ruby as a global, execute the following command:
To confirm the latest Ruby version, use the following command.
You can also install Ruby through the built-in Ruby Version Manager (RVM). To perform the installation through this method, use the following steps.
Step 1: Update packages using the following command:
Step 2: Install required dependencies with the following command-line.
Step 3: Now, install RVM by executing the below-given command:
Step 4: Next, execute the following command to find out the available version on RVM:
As 3.1.2 is the latest version, so execute the following installation command to install the latest version of Ruby on Ubuntu:
The above command will successfully install Ruby on Ubuntu and you can begin creating different applications with ease by implementing code in Ruby language.
Ubuntu 22.04 repository also includes the Ruby which you can easily install using the following steps. However, it doesn’t install the latest version but still it’s the easiest method to install Ruby on Ubuntu.
Step 1: Update the apt package system using the following command:
Step 2: Then use the below-mentioned command to install Ruby on Ubuntu:
Step 3: After the Ruby installation is completed, you can then check the version using the following command.
To remove Ruby from Ubuntu 22.04 repository, execute the below-mentioned command.
Ruby is an open-source and robust programming language used to develop different web applications. There are several methods to install Ruby on Ubuntu 22.04 mentioned in this article. If you want to install the latest version of Ruby, you can pick the Rbnev or RVM method and to ease the installation, you can install Ruby through the apt command.
Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…
Our commitment to building a thriving open source community is stronger than ever. We believe…
The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…
June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…
Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…
Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…