Ubuntu

Install Ruby on Ubuntu 20.04

Install Ruby on Ubuntu

Introduction:

Ruby is a high-level programming language developed in the mid-90s. It also supports functional and object-oriented programming. Ruby and Ruby on Rails differ from each other in a sense that the former one is a general-purpose programming language whereas the latter one is a web-based framework. Today, we will learn to install Ruby on a Ubuntu 20.04 system.

Method of Installing Ruby on Ubuntu 20.04:

For installing the latest available and compatible version of Ruby on your Ubuntu 20.04 system, following steps should be performed:

Step # 1: Perform Ubuntu 20.04 System Cache’s Update:

We need to update our Ubuntu 20.04 system’s cache by executing the command shown below:

$ sudo apt-get update

Once the system update will complete successfully, your Ubuntu 20.04 system will display the following messages on the terminal:

Step # 2: Install the Latest Compatible Version of Ruby on your Ubuntu 20.04 System:

Now, we need to install the latest available and compatible version of Ruby on our Ubuntu 20.04 system with the command shown below:

$ sudo apt install ruby-full

Once the execution of Ruby will complete on our Ubuntu 20.04 system, the following messages will be displayed on the terminal:

Step # 3: Verify the Successful Installation of Ruby on your Ubuntu 20.04 System:

You can even verify the successful installation of Ruby on your Ubuntu 20.04 system by checking its version with the command shown below:

$ ruby --version

The version of Ruby installed on our Ubuntu 20.04 system is 2.7.0 as shown in the following image:

Method of Removing Ruby from Ubuntu 20.04:

For removing Ruby from your Ubuntu 20.04 system, you have to execute the command shown below:

$ sudo apt-get purge ruby

This command will remove Ruby and its configuration files from your Ubuntu 20.04 system as shown in the following image:

Now, you can also remove the irrelevant packages and dependencies from your Ubuntu 20.04 system for freeing up the occupied space with the command shown below:

$ sudo apt-get autoremove

Running this command will free up a significant amount of your Ubuntu 20.04 system’s space as shown in the following image:

Conclusion:

In this article, we threw light on the method of installing Ruby on a Ubuntu 20.04 system. Also, if you want to remove this programming language from your Ubuntu 20.04 system, then you can also do this by the method that we have shared with you in the last section of our article.

Similar Posts