Sinatra on Ubuntu 11.04

Nov 22, 2011

The following guide is non-authoritative and probably will not work for you. It is simply the commands I use to reproduce a particular environment: Ruby 1.8.7 with Gems 1.8.10 and Sinatra (using Thin).

Before we get started, here is some information about my system:

ubuntu@domU-12-31-38-04-6D-D7:~$ uname -a
Linux domU-12-31-38-04-6D-D7 2.6.38-8-virtual #42-Ubuntu SMP Mon Apr 11 07:04:38 UTC 2011 i686 i686 i386 GNU/Linux
ubuntu@domU-12-31-38-04-6D-D7:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 11.04
Release:	11.04
Codename:	natty

1. Install the necessary Ubuntu packages (not sure if you need all of these).

sudo apt-get install git build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev 

Note: For Ubuntu 11.10 use libreadline-gplv2-dev instead of libreadline5-dev

2. Install RVM. At the time of writing this, the Ruby and Gems in the official repo are a little out of date. Note: I am running this as root for a multi-user install (more on this can be found here.)
sudo bash < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

3. Add necessary users to the RVM group.

sudo usermod -a -G rvm ubuntu

4. Now you need to restart your shell for the changes to take affect. You can try to source the necessary files, but it is just as easy to exit and restart a new session.

5. At this point, it is a good idea to run rvm notes and rvm requirements and do/install anything it tells you (at the time of writing this, there was nothing extra I needed to install. By the time you read this, that probably will not be the case)

6. I was having some major problems with zlib, so I had to install that (here for more information).

rvm pkg install zlib

7. Install Ruby 1.8.7 and set it as the default

rvm install 1.8.7
rvm --defaut use 1.8.7

8. Install Sinatra and Thin

gem install sinatra
gem install thin