Latest Ruby Ubuntu 18.04 Installation Guide
Hi! The Guide shows you Step-by-Step How to Install the Latest Ruby on Ubuntu 18.04 Bionic LTS GNU/Linux Desktop/Server.
First, of All to Install the Latest Ruby in Ubuntu 18.04 follow the instructions to Setup the PPA Repository.
And Ruby Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.
Finally, included you find instructions on How to Getting-Started Easily Learning Ruby Programming on Ubuntu Linux.

How to Add Latest Ruby Repo for Ubuntu
Then to Install the Latest Ruby for Ubuntu.
First, to Look up All Available Ubuntu Versions do:
sudo apt search ruby | grep ruby
Then to Install Ruby 2.5:
sudo apt install ruby2.5
How to Getting-Started with Ruby on Ubuntu Linux