Amazon Linux 2012.03 now comes with ruby 1.9.3
To install it (as per the docs)
sudo yum install ruby19
But ruby -v
shows 1.8.7
. How would I switch it over 1.9.3 (If its already there there would be no need to use RVM yes?)
The right way to do this on Amazon Linux is:
sudo yum update (to get latest version of Amazon Linux (2013.09 at time of this answer)
yum install ruby19
alternatives --set ruby /usr/bin/ruby1.9
Supplementing @baboonWorksFine's answer, there are a number of 1.9 commands that can be symlinked as their undecorated equivalents. What I did was:
sudo -s
for f in /usr/bin/*1.9
do
ln -s $f ${f%1.9}
done
That way, you don't accidentally miss any commands that need aliasing.
If you do this:
ls -l /usr/bin/ruby*
you will probably see this:
lrwxrwxrwx 1 root root 7 Apr 26 18:27 /usr/bin/ruby -> ruby1.8
-rwxr-xr-x 1 root root 3720 Mar 29 08:29 /usr/bin/ruby1.8
-rwxr-xr-x 1 root root 3888 Mar 29 12:26 /usr/bin/ruby1.9
This is well self explained. So what you wanna do is:
rm /usr/bin/ruby && ln -s /usr/bin/ruby1.9 /usr/bin/ruby
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With