CA BD NY
  • Categories

  • Recent Posts

  • RSS MySQL Hacker

  • RSS Apache Hacker

  • RSS MiniCTO

  • Meta

  • Installing Ruby, Rails and Their Friends: Phusion Passenger, Enterprise Ruby on CentOS 5.3

    Published May 19th, 2009

    As we are moving to Ruby on Rails platform and only maintaining PHP 5 projects until they are
    replaced with RoR versions, we are deploying RoR on our development network. Here is our quick guide to RoR installations
    on CentOS 5.3.

    Setting up Ruby on Rails with friends

    1. Download Ruby source and compile using: ./configure && make && make install
    2. Download RubyGems source and install using ruby setup.rb
    3. Upgrade RubyGems using gem install rubygems-update
    4. Install Rails using gem install rails
    5. Install JSON using gem install json
    6. Install SQLite3 using gem install sqlite3-ruby
    7. Install MySQL support using gem install mysql or gem install dbd-mysql
      fails so here is what works:

      • Download MySQL extension for ruby using wget http://rubyforge.org/frs/download.php/51087/mysql-ruby-2.8.1.tar.gz
      • After extracting it run: ruby extconf.rb –with-mysql-config && make && make install
    8. To find out what extensions were installed using gem, run: gem list

    Setting up Phusion Passenger for Apache

    We want to use the Phusion Passenger with Enterprise Ruby so here how to install these goodies.
    To install Phusion Passenger run:

    • gem install passenger
    • By default, the passenger installer looks for Apache in /usr/sbin/httpd which is not where we install our custom Apache
      server so we created a symbolic link that points /usr/sbin/httpd to /home/apache/bin/httpd
    • Also, we installed few Apache tools that the installer needs using yum -y install httpd-devel apr-devel
    • Run: passenger-install-apache2-module
    • After the Apache 2 module was successfully installed, we edited the Apache configuration file, and added these
      lines:

      LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
      PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2
      PassengerRuby /usr/local/bin/ruby
    • Restart Apache
    • After restarting Apache, deploy any number of Ruby on Rails applications on Apache by pointing DocumentRoot to the public directory
      of the RoR project

    Going Enterprise with Ruby on Rails

    To install Enterprise Ruby do the following

    • Download Enterprise Ruby source and extract in /usr/local/src
    • From the newly created directory, run ./installer
    • Follow the prompts
    • After installing Enterprise Ruby, reinstall Phusion Passenger as requested by the Enterprise Ruby installer
    • You are now ready to use Enterprise Ruby

    Get a Trackback link

    No Comments Yet

    Be the first to comment!

    Leave a comment

    Comment Policy: First time comments are moderated. Please be patient.