3

I booted up a amazon linux machine in which the default ruby version was ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]. I want to update it to 2.6.3.

I found this article How to upgrade ruby version in Amazon Linux system?. But when I ran sudo yum install -y ruby26 it says ruby26 not found. There was no other article.

Kaushik Vijayakumar
  • 755
  • 3
  • 10
  • 19

1 Answers1

3

Both RVM and rbenv will allow you to install the correct version of Ruby you need for your application. They are both distro agnostic so you can run installation commands as simple as this:

gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile
rvm install "ruby-2.6.3"
rvm use 2.6.3 --default

The full list of Ruby managers are here, along with several other tools and Installers that explain how to manually install a later version of Ruby.

When all else fails, build from source.

sjagr
  • 15,983
  • 5
  • 40
  • 67
  • I did it using rvm.. But I'm actually trying to run my ruby files using an application (Rundeck). It doesn't pick the ruby installed by rvm. It fails to run and if I give the path of ruby to the application it fails to find the gems used in the scripts. – Kaushik Vijayakumar Jul 23 '19 at 17:47