I'm a programmer specialising in performant and scalable systems using PHP and Ruby and cooking

On Ubuntu | Ruby

Installing Ruby Enterprise Edition on Ubuntu 12.04

I've recently had to install ruby enterprise edition on a few servers lately and found 2 issues (1 I gave up on and 1 that is simple to fix)

Firstly quickly the first issue; the ruby enterprise website offers a debian packaged version for ubuntu users, I found this to have an issue with openssl support when you try to install Passenger.

So here is how to install ruby enterprise edition (and fix the silly error) from source.

Download the source bundle
Extract the tarball (ruby-enterprise-1.8.7-2012.02.tar.gz at time of writing)

tar -xzf ruby-enterprise-x.x.x-xxxx.xx.tar.gz  

If you tried to build at this point you will hit an error about duplicate methods. This is actually very simple to fix, open source/distro/google-perftools-1.7/src/tcmalloc.cc in your favorite editor and g to line 1672. You will see this:

void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride;  

However this should look like this:

void *(* volatile __memalign_hook)(size_t, size_t, const void *) = MemalignOverride;  

Save and close the file.

Install ruby by running the guided installer:

$ sudo ./installer

(if you want MySQL support installed now you should install the libmysqlclient-dev package with aptitude before running the installer)

If all goes well you should have ruby enterprise installed, finally to make this your default ruby enterpreter you can edit your /etc/environment file so that the first line looks like this: