Call Us! 1-800-383-5193
Call Us! 1-800-383-5193
Call Us! 1-800-383-5193

Need Help?

Emergency Response Time custom

Our experts have had an average response time of 11.06 minutes in March 2021 to fix urgent issues.

We will keep your servers stable, secure and fast at all times for one fixed price.

Deploying Ruby on Rails

by | Mar 28, 2006

This article is an introduction to the installation and deployment of Ruby on Rails.

What is Ruby on Rails?

Ruby is a programming language just like Perl, Python or PHP. Rails is an open source Ruby framework for developing database-backed web applications. You could develop a web application at least ten times faster with Rails than you could with a typical Java framework. It is a web application framework written in the Ruby programming language.

We tried the installation of Ruby on Rails on a server with this configuration:
1. Red Hat Linux release 7.3
2. Plesk 5.0.5
3. Apache 1.3.27
4. PHP 4.3.4 # Run as an Apache Module

Install Ruby

Before installing Ruby, first check if zlib is installed in PHP. You can do this by running a simple script with this code.

<?php phpinfo(); ?>

Now you are all set to start the installation.

 cd /usr/local/src
 tar xvzf ruby-1.8.2.tar.gz
 cd ruby-1.8.2
 make install
 ruby rubytest.rb

If the installaiton is successful, then you will get a message “test succeeded”.

Install RubyGems

 cd /usr/local/src
 tar xvzf rubygems-0.8.11.tgz
 cd rubygems-0.8.11
 ruby setup.rb all

This step involves execution of `ruby setup.rb` with arguments `config / setup / install` all together

 gem query --local
 gem q -L

Listing all installed gems

Install Rails

 gem install rails   OR # (Enter Y for all dependencies)
 gem install rails --include-dependencies

Install FastCGI

 tar -xvzf fcgi-2.4.0.tar.gz
 cd fcgi-2.4.0
 make install

Install mod_fastcgi

 tar -xvzf mod_fastcgi-2.4.2.tar.gz
 cd mod_fastcgi-2.4.2
 /path/to/apxs -o -c *.c
 /path/to/apxs -i -a -n fastcgi

In Apache’s httpd.conf, add this line.

 Include /path/to/httpd/conf/fastcgi.conf

Now, add this text to fastcgi.conf

cat > /path/to/httpd/conf/fastcgi.conf
    User apache
    Group apache
    <IfModule mod_fastcgi.c>
    FastCgiConfig -idle-timeout 900
    AddHandler fastcgi-script .fcgi .fpl .rb
    FastCgiIpcDir /tmp/fastcgi_ipc/
    FastCgiSuexec /usr/sbin/suexec
 To make FastCGI run as suexec. Use path to suexec

Ctrl + D
 mkdir /tmp/fastcgi_ipc/
 chown -R apache.apache /tmp/fastcgi_ipc
 chmod 700 /tmp/fastcgi_ipc/
 service httpd restart

NOTE : In some systems, the ownership of fastcgi_ipc is done by Apache itself, but its safe to include these steps in your routine.

Related files: /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/dispatches/dispatch.fcgi # OR ~USER/<app_name>/public/dispatch.fcgi # Log file declaration & all

Install gem bindings

To install gem bindings for Fastcgi and MySQL

 gem install fcgi
 gem install mysql


1. Install Test Application

 cd ~USER
 rails testapp  # Create a test application named 'testapp'
 cd testapp/
 ./script/generate controller test
 cd ~USER/httpdocs
 ln -s ~USER/testapp/public rails
# In order to access the test application
'~USER/testapp/public' from the browser

In order to allow symlinks, enter the following in to ~USER/httpdocs/.htaccess

 Options Indexes +FollowSymLinks

Now you need to set the correct ownership and permissions for the test application. I did the following for my project. You can learn from the example:

 cd ~USER
 chown -R USER.psacln testapp
 chmod -R 755 testapp
 chown -R USER.psacln httpdocs/rails
 chmod -R 755 httpdocs/rails

Create Test Pages

cd ~USER
cd ~USER/testapp/app/controllers

Create a file called test_controller.rb and put in the following code:

cat > test_controller.rb
  class TestController < ApplicationController
  def hi
  render :text => 'Hi world'
  def hello
  def index
  render :text => 'Hi! This is the Index.'
Ctrl + D

Now create the test page.

cat > ~USER/testapp/app/views/test/hello.rhtml # The test page
     <title>Hello World</title>
     <h1>Hello from Rails!</h1>
     <p>The current time is <%= %></p>

Ctrl + D

Now just access the URL: http://yourdomain/rails/test/hi

NOTE:- Remember to change ownership of the test pages you created.

Congrats! You have installed Ruby On Rails 🙂


Installing Ruby on Rails in Plesk

Articles by Rashid Mullali Mohamed Kunhi About the author:
Rashid Mullali Mohamed Kunhi works in Bobcares as Jr. Engineer. He primarily works on Plesk servers on Linux.


  1. good article on installation of ruby and it’s extension above method working for me.

  2. Such a useful information sharing and it’s really very helpful for everyone. Thanks for sharing that.

server management

Spend time on your business, not on your servers.


Or click here to learn more.

server management

Spend time on your business, not on your servers.


Or click here to learn more.