How to install Ruby and RubyGems on Ubuntu 18.04 LTS and 19.04

Today we’ll be looking at how to install Ruby and RubyGems on Ubuntu 18.04 LTS and Ubuntu 19.04.

The installation steps listed in this article will work for both versions of Ubuntu, 18.04 LTS and 19.04.

A little bit about Ruby from their website:

And RubyGems from Wikipedia:

Update your OS

Start off by making sure your version of Ubuntu is up to date, issue the following at the terminal to do so:

Install Ruby and RubyGems

Now to the actual part, issue the following to install Ruby on your server:

You’ve just installed both Ruby and RubyGems. RubyGems comes bundled with Ruby on Ubuntu.

Verify the installation

To verify that both Ruby and RubyGems were successfully installed after the last command, issue the following at the terminal

That’s it, you’re done!