Install Ruby On Rails on Ubuntu 16.04 | 18.04 | 18.10

Ruby on Rails, a web application framework that helps you build great applications and websites can easily be installed and setup on Ubuntu systems using the steps below… Many beautiful applications and websites are built on Ruby programming language… and setting up your environment is the first step…

This brief tutorial shows students and new users how to setup a Ruby on Rails environment on Ubuntu 16.04 | 18.04 and 18.10…

There are many tutorials online that will help you setup your own environment… however, this post will make it easy for students and new users who are just learning how to create their own Ruby on Rails environments…

When you’re ready to get your environment setup, follow the steps below:These are the packages we’re going to be setting up…

Ruby version 2.5.3

Rails version 5.2.1

MariaDB

Step 1: Installing Ruby

To install Ruby and Rails on Ubuntu, you’ll need to install some dependencies… To make that happen, install Node.js and Yarn repositories… This will make installing the dependencies easier…

First install these curl and git packages…

sudo apt update
sudo apt install curl git

Than run the commands below to add Node.js and Yarn repositories and keys to your system…. Then install some core packages to get your environment going…

After setting up your local profile… run the commands below to install Ruby version 2.5.3… If a newer version is available, replace the version number to that… vist this site to find out Ruby latest versions….

rbenv install 2.5.3
rbenv global 2.5.3

To verify that Ruby is installed, run the commands below:

ruby -v

You should see similar lines as below:

ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]

Another package management you’ll want to install is bundler… to do that, run the commands below

gem install bundler

Now run the command below after installing bundler…

rbenv rehash

Step 2: Install Rails

Now that Ruby environment is set up, run the commands below to install Rails… Rails can be installed from a Node.Js… Run the commands below to install Node.js repository, then install Node.js package…