How To Install ruby-turbolinks on Ubuntu 18.04

In this tutorial we learn how to install ruby-turbolinks on Ubuntu 18.04. ruby-turbolinks is following links in your Rails web application faster

Introduction

In this tutorial we learn how to install ruby-turbolinks on Ubuntu 18.04.

ruby-turbolinks is:

Turbolinks makes following links in your Rails web application faster. Instead of letting the browser recompile the JavaScript and CSS between each page change, it keeps the current page instance alive and replaces only the body and the title in the head. Think CGI vs persistent process.

This is similar to pjax, but instead of worrying about what element on the page to replace, and tailoring the server-side response to fit, the entire body is replaced. This means that you get the bulk of the speed benefits from pjax (no recompiling of the JavaScript or CSS) without having to tailor the server-side response. It just works.

There are three methods to install ruby-turbolinks 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.

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

sudo apt-get update

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

sudo apt-get -y install ruby-turbolinks

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install ruby-turbolinks

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 ruby-turbolinks using aptitude by running the following command:

sudo aptitude -y install ruby-turbolinks

To uninstall only the ruby-turbolinks package we can use the following command:

sudo apt-get remove ruby-turbolinks

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

sudo apt-get -y autoremove ruby-turbolinks

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

sudo apt-get -y purge ruby-turbolinks

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

sudo apt-get -y autoremove --purge ruby-turbolinks

References

Summary

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