I recently spun up a server that had Amazon's default Linux distro. I was disappointed to find that the version of Ruby I want (2.2.3) is unavailable. Is their a distro that will let me upgrade past the default version (ruby 2.0.0p648 (2015-12-16) [x86_64-linux])
2 Answers
If you are running Amazon Linux 2, the newer Ruby versions are no longer available via yum. Instead, use:
sudo amazon-linux-extras install ruby2.4
If you are using Amazon Linux, then you need to run this command to install Ruby 2.3:
sudo yum install ruby23
-
it says it's installed, however, when I run
ruby -v
it says:ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
I restarted my env and still says the same thing. I might be missing something here...– mklemosSep 16, 2017 at 20:48 -
1You have multiple versions of ruby installed now, and ruby 2.0 is still the one configured as the default. To change the default version of ruby on your system run
sudo update-alternatives --config ruby
and then select the version you want as the new default. You can also runls -l /etc/alternatives/ruby*
to see what versions are installed, and use the symbolic links there to run a specific version.– Mark BSep 16, 2017 at 21:01 -
Running the Amazon Linux 2 AMI, I cannot install Ruby 2.3 (I only have 2.0 as noted above):
$ sudo yum install -y ruby23 Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 2.4 kB 00:00:00 158 packages excluded due to repository priority protections No package ruby23 available. Error: Nothing to do
I also tried this with --disableplugins=priorities (after running sudo yum update --disableplugsin=priorities) with no improvement.– Henry GOct 1, 2018 at 10:41 -
1If you are running Amazon LInux 2, instead of yum you have to use
sudo amazon-linux-extras install ruby2.4
– Henry GOct 1, 2018 at 11:40