How to upgrade ruby version in Amazon Linux system?
If you are running Amazon Linux 2, later versions of popular software packages (including Ruby) are installed using the Extras Library. To see the latest available version:
$ amazon-linux-extras list
You'll need sudo
privileges to install:
$ sudo amazon-linux-extras install ruby2.6
To install ruby 2.4 do this, sudo yum install -y ruby24
.
And to make 2.4 the default version (the old version will still be there) do this, sudo alternatives --set ruby /usr/bin/ruby2.4
.