How to Install Ruby on Ubuntu 18.04 Bionic Beaver

Install Ruby on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Ruby on Ubuntu 18.04 LTS. 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, open-source programming language behind Ruby on Rails framework. It is especially appealing to beginners because of its highly readable and clear syntax, allowing users to develop faster and more efficiently.

Install Ruby on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Install Ruby.

  • Install Ruby using Rbenv:

Next, run the following curl command to install both rbenv and ruby-build:

Before starting using rbenv we need to add $HOME/.rbenv/bin to our PATH:

The current latest stable version for Ruby is 2.6.1 at the time of writing this tutorial. Run below command to install Ruby:

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

  • Install Ruby from Ubuntu Repositories.

Start the Ruby installation process by running the command:

To verify that the installation it was successful run the following command which will print the Ruby version:

That’s all you need to do to install Ruby on Ubuntu 18.04 Bionic Beaver. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.