Before installing, you can check if Ruby is already installed in the system by running the following command in the terminal:
which ruby
Ruby is already installed if the output shows a path as usr/bin/ruby/. If an error message is displayed instead, Ruby is not installed.
The easiest way to install Ruby on Linux-based systems is through the apt package manager, by running commands in the terminal. The steps involved are as follows:
Update the packages index by running the following command in the terminal:
sudo apt update
Install Ruby by typing the following command in the terminal:
sudo apt install ruby-full
To verify that Ruby has been installed successfully, run the following command:
ruby --version
Free Resources