«

»

Print this Post

Installing Ruby 1.9.3 on a Linux AMI on Amazon AWS

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

Permanent link to this article: http://www.johnvarghese.com/installing-ruby-1-9-3-on-a-linux-ami-on-amazon-aws/

5 comments

Skip to comment form

  1. tesh

    super helpful — thanks.

    1. JohnVarghese

      @tesh You are welcome. I am glad it was helpful.

  2. cdtoad

    Very Cool! Very quickly did what I needed to do!

  3. therealkris

    Very helpful. Thanks!

  4. 0xSina

    Dude, thanks so much! I always forget and have to come back to this tutorial!!!!

Leave a Reply