My machine has simply capped at ruby version 2.5, ruby -v
outputs ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
. I have tried sudo apt update && sudo apt upgrade
, and sudo apt-get install ruby-full
, but non of which have seemed to work.
My ubuntu 18.04 machine will not install ruby version 2.7
1.2k Views Asked by Zak At
2
There are 2 best solutions below
0

The supported version is usually not up to date.
A common way is using any of those Ruby version management tools, such as:
- chruby (use together with ruby-install)
- rbenv
- rvm
Here is the list of ruby version management tools on the official site.
If this isn't what you aren't looking for, try to install the Ruby from source.
Lastly, you can use a Ruby Docker image to run the Ruby script.
from: https://phoenixnap.com/kb/how-to-install-ruby-on-ubuntu-18-04 there are other ways, just visit the link to watch some of them
Example 2: By using rbenv
and from the list select the one you want and install it