HowTo notes: installing REE, Passenger, Ruby on Rails on CentOS5

Recently, I installed Redmine, the Rails-based project tracker,  on an existing virtual private server, running CentOS 5 Linux and an assortment of LAMP applications and web sites using Apache, PHP and MySQL. I chose Ruby Enterprise Edition (REE), an optimized and high-performance version of Ruby, and Passenger, an Apache module to connect to Ruby. Here are the steps I followed, as a reference and in hopes it might help others:

  1. Log onto the box via ssh. As a good practice, I run as an unprivileged user, and use sudo only when superuser rights are needed. So, download the files and un-tar them and read the READMEs and run the processes as a regular user, switching to root via sudo only when the rights are needed.
  2. Download and install Ruby Enterprise Edition. Today, that’s:
    wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz

    but follow the instructions you’ll find at http://www.rubyenterpriseedition.com/download.html for the latest. Those instructions will have you un-tar the file and then run the installer.

  3. Install the tools needed to build Ruby Enterprise Edition. If you run the installer, it will prompt you for missing tools. In my case, I needed to:
    sudo yum install gcc-c++ make patch zlib-devel openssl-devel readline-devel
  4. If you’ll be using mysql, you’ll need the native code to build the matching gem. REE attempts to build gems for MySQL, SQLite and PostgreSQL, so choose your flavor and issue the appropriate command like:
    sudo yum install mysql-devel
    

    or postgresql-devel or sqlite-devel as appropriate.

  5. Follow the instructions supplied by the REE installer. They did a nice job on that. To install Passenger when I was done, some additional source code files were required:
    sudo yum install httpd-devel apr-devel
    sudo /opt/ruby-enterprise-1.8.7-2010.01/bin/passenger-install-apache2-module
  6. Once again, follow the prompts to add the proper load module and path commands to your web server configuration, add a configuration file for your site, and you’re ready to start installing your site’s code.

NOTE: It wasn’t the case with my particular host, but you may need to adjust your SELinux settings, if you’ve got SELinux enabled. See the post at http://www.catapult-creative.com/2009/02/04/installing-rails-on-centos-5/ and look for “SELinux” for some ideas.

, , , ,

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.