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.
Asked
Active
Viewed 897 times
0

Andy Lester
- 91,102
- 13
- 100
- 152

Zak
- 1
- 1
-
You may find it easier to work with a version manager tool, like `rbenv`, to install and use different Ruby versions : https://github.com/rbenv/rbenv#readme – Yoni A Mar 15 '22 at 09:02
2 Answers
0
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
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
sudo apt install rbenv
echo 'export PATH="$HOME/ .rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init –)"' >> ~/.bashrc
rbenv install --list
and from the list select the one you want and install it
ex:
rbenv install rbx-2.7

Aqib Javed
- 935
- 1
- 5
- 15

jackBrown
- 1
- 2
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.

duykhoa
- 2,227
- 1
- 25
- 43