First we need to get the latest build of Ruby Enterprise Edition (Ruby EE from now on) from http://www.rubyenterpriseedition.com
$ wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz
This is the latest at the time of this writing. Check the website for the most recent and just check your version numbers in the next steps.
Now we need to extract the source
$ tar xzvf ruby-enterprise-1.8.7-2010.01.tar.gzNow we can start the install
$ sudo ./ruby-enterprise-1.8.7-2010.01/installer
The installer will auto check for dependencies like the C Compiler, the make tool, OpenSSL, etc. If you’re missing any of these it will show you the command to run which is a simple
$ sudo yum install OpenSSL
After we pass the checks, we can start the install. It will ask for the “Target directory” we would like to install RubyEE in. By default it’s /opt/ruby-enterprise-X.X.X-XXXX.XX I change mine to simply be /opt/ruby-enterprise which makes upgrades a bit easier.
Now you’ll see a lot of output on the screen as it installs RubyEE. You may also notice that the installer will install some useful libraries such as Rails, Passenger etc.
Now if you type
$ which rubyYou’ll probably get A: no ruby in (/some/directories/) or B: The path to your original install of ruby on your machine. To fix this we will set the path up in /etc/profile.d/ruby.sh
Open that file in your favorite editor, or create it if it doesn’t exist with
$ sudo nano /etc/profile.d/ruby.sh
Inside that file add
export PATH=/opt/ruby-enterprise/bin:${PATH}
Then reload the profile by running
$ source /etc/profile
Now if you run which ruby it will find it. You can also do
$ ruby -vwhich should return something like
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
You are now done! Now you can install gems under the RubyEE version just by calling the gem command and not the full path of /opt/ruby-enterprise
My next article will be on installing, configuring, and using Passenger.
