How to Install Ruby on Rails on cPanel

Description: "Ruby on Rails is a free web application framework that aims to increase the speed and ease with which database-driven web sites can be created and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby on Rails is an open source project written in the Ruby programming language and applications using the Rails framework are developed using the Model-View-Controller design paradigm."
( Font )

This tutorial will help you to install Ruby on Rails on a cPanel system:

1. Installing Ruby:

# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
# tar -xvzf ruby-1.8.6.tar.gz
# cd ruby-1.8.6
# ./configure
# make
# make install

2. Installing the Gems and Rails:

# wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
# tar -xvzf rubygems-0.9.0.tgz
# cd rubygems-0.9.0
# ruby setup.rb
# gem install rails

3. Installing FastCGI - "FastCGI is a protocol for interfacing interactive programs with a web server. FastCGI is a variation on the earlier Common Gateway Interface (CGI); FastCGI's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing a server to handle more web page requests at once."
( Font )

# wget fastcgi.com/dist/fcgi-2.4.0.tar.gz
# tar -xvzf fcgi-2.4.0.tar.gz
# cd fcgi-2.4.0
# ./configure
# make
# make install

# wget fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
# tar -xvzf mod_fastcgi-2.4.2.tar.gz
# cd mod_fastcgi-2.4.2
# /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
# /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so
# gem install fcgi

Edit the Apache config file:
# nano /usr/local/apache/conf/httpd.conf

Now and add the fcgi module:

LoadModule fastcgi_module libexec/mod_fastcgi.so
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
< /IfModule>

Save, exit and restart Apache

Installing RMagick and GetText:

# wget http://umn.dl.sourceforge.net/sourceforge/graphicsmagick/GraphicsMagick-1.1.7.tar.gz
# tar -xvzf GraphicsMagick-1.1.7.tar.gz
# cd GraphicsMagick-1.1.7
# ./configure
# make
# make install

Installing MySql for Ruby:
#gem install MySql

It should be fine ..

1 Comments:

Anonymous said...

ssh: /scripts/installruby ;)