How to Install Ruby on Debian 10

Install Ruby on Debian 10

In this article, we will have explained the necessary steps to install and configure Ruby on Debian 10. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Ruby is a dynamic, object-oriented programming language focused on simplicity and productivity. RVM (Ruby Version Manager) is a tool for installing and managing multiple Ruby versions on single operating systems.

Install Ruby on Debian

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install Ruby.

  • Install Ruby from Debian Repository.

Start the Ruby installation process by running the command:

Confirm the installation and check the version using below command:

  • Install Ruby using RVM.

First install the dependencies required for the RVM utility to build Ruby from source:

Next, run the following commands to add the GPG key and install RVM:

  • Install Ruby using Rbenv.

Install required dependencies for installing rbenv and ruby-build:

Next, clone rbenv package typing following command in the terminal:

After completing the above command, Set the path for rbenv and complete the installation by typing below commands:

Then, install ruby-build plugin for Rbenv run below git command first:

After completing above command, Complete the installation and set the path for ruby-build by using below command:

You should confirm the installation and check the version of Ruby using below command:

Congratulation, you have learned how to install and configure Ruby on Debian 10 Buster. If you have any question, please leave a comment below.