3

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])

1
  • if you are fussy about the ruby version then you probably want to run rvm
    – Vorsprung
    Sep 18, 2017 at 14:18

2 Answers 2

9

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
1
3

If you are using Amazon Linux, then you need to run this command to install Ruby 2.3:

sudo yum install ruby23
4
  • 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...
    – mklemos
    Sep 16, 2017 at 20:48
  • 1
    You 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 run ls -l /etc/alternatives/ruby* to see what versions are installed, and use the symbolic links there to run a specific version.
    – Mark B
    Sep 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 G
    Oct 1, 2018 at 10:41
  • 1
    If you are running Amazon LInux 2, instead of yum you have to use sudo amazon-linux-extras install ruby2.4
    – Henry G
    Oct 1, 2018 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.