
As of April 2012, if you create a new virtual machine in the Amazon Cloud, the default installation that contains Ruby still installs Ruby 1.8.7. But the most recent stable version is Ruby 1.9.3. And it has been stable for a while. So you really want to use that.
As you may know, the best way to manage multiple versions of Ruby is by using the Ruby Version Manger – rvm. If you have read my previous documentation on how to install RVM and Ruby 1.9.2 on the Mac, it is very different on Linux. Not only that, the RVM repository has moved permanently to its new home, so the rvm installation commands will not work.
So without further delay, here is the set of commands I ran to install rvm and ruby 1.9.3. Note that I did not set 1.9.3 as the default. The next time you start any new shell, 1.9.3 becomes the default by itself. Note also that you need to run all the commands as root. So I start with “sudo -s”.
sudo -s
yum update
ruby -v
groupadd rvm
gpasswd -a ec2-user rvm
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
curl -L get.rvm.io |bash -s stable
rvm install 1.9.3
ruby -v
I then installed sinatra, shotgun and thin
rvm rubygems latest
gem install sinatra
gem install thin
gem install shotgun

5 comments
Skip to comment form ↓
tesh
September 25, 2012 at 7:11 pm (UTC -8) Link to this comment
super helpful — thanks.
JohnVarghese
September 25, 2012 at 8:11 pm (UTC -8) Link to this comment
@tesh You are welcome. I am glad it was helpful.
cdtoad
October 17, 2012 at 10:29 am (UTC -8) Link to this comment
Very Cool! Very quickly did what I needed to do!
therealkris
December 25, 2012 at 7:12 pm (UTC -8) Link to this comment
Very helpful. Thanks!
0xSina
January 24, 2013 at 9:19 am (UTC -8) Link to this comment
Dude, thanks so much! I always forget and have to come back to this tutorial!!!!