Ruby version updation
Step 1: Download Updates and Dependencies
Start by updating the system repositories:
sudo apt update
Download and install the libraries and compilers Ruby needs to run:
sudo apt install git curl autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
refeerence: https://phoenixnap.com/kb/install-ruby-ubuntu