How To Install rake-compiler on Ubuntu 18.04

In this tutorial we learn how to install rake-compiler on Ubuntu 18.04. rake-compiler is Rake-based Ruby Extension (C, Java) task generator

Introduction

In this tutorial we learn how to install rake-compiler on Ubuntu 18.04.

What is rake-compiler

rake-compiler is:

The rake-compiler is first and foremost a productivity tool for Ruby developers. It’s goal is to make the busy developer’s life easier by simplifying the building and packaging of Ruby extensions by simplifying code and reducing duplication.

It follows convention over configuration by advocating a standardized build and package structure for both C and Java based RubyGems.

Rake-compiler is the result of many hard-won experiences dealing with several diverse RubyGems that provided native extensions for different platforms and different user configurations in different ways. Details such as differences in code portability, differences in code clarity, and differences in project directory structure often made it very difficult for newcomers to those RubyGems.

There are three methods to install rake-compiler on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install rake-compiler Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install rake-compiler using apt-get by running the following command:

sudo apt-get -y install rake-compiler

Install rake-compiler Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install rake-compiler using apt by running the following command:

sudo apt -y install rake-compiler

Install rake-compiler Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install rake-compiler using aptitude by running the following command:

sudo aptitude -y install rake-compiler

How To Uninstall rake-compiler on Ubuntu 18.04

To uninstall only the rake-compiler package we can use the following command:

sudo apt-get remove rake-compiler

Uninstall rake-compiler And Its Dependencies

To uninstall rake-compiler and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove rake-compiler

Remove rake-compiler Configurations and Data

To remove rake-compiler configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge rake-compiler

Remove rake-compiler configuration, data, and all of its dependencies

We can use the following command to remove rake-compiler configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge rake-compiler

References

Summary

In this tutorial we learn how to install rake-compiler package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.