Installing Ruby, Rails and Their Friends: Phusion Passenger, Enterprise Ruby on CentOS 5.3
Published May 19th, 2009As 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
- Download Ruby source and compile using: ./configure && make && make install
- Download RubyGems source and install using ruby setup.rb
- Upgrade RubyGems using gem install rubygems-update
- Install Rails using gem install rails
- Install JSON using gem install json
- Install SQLite3 using gem install sqlite3-ruby
- 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
- 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
Leave a comment
Comment Policy: First time comments are moderated. Please be patient.