How to install Ruby On Rails, The Ruby On Rails easy installation tutorial

April 14, 2009 · 1 comment

in Information, Troubleshoot, Web Hosting



Installation of Ruby On Rails would never be more easier. Here we provide the simple installation method. Please only use this on dedicated servers. Source from Wiki.

Install Ruby: (You can grab the latest source package from http://ruby-lang.org/en/20020102.html)

$ cd /usr/local/src
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
$ tar -xvzf ruby-1.8.4.tar.gz
$ cd ruby-1.8.4
$ ./configure && make && make install

Next Ruby Gems: (Latest version and localized mirrors here http://rubyforge.org/frs/?group_id=126 )

$ cd /usr/local/src
$ wget 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

Once Gems are installed its a whirl to install Rails:

$ gem install rails –include-dependencies

Now for FastCGI? and getting it to play nicely with Apache.

Install FastCGI?:

$ cd /usr/local/src
$ 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

And mod_fastcgi for Apache 1.3+ as DSO because cPanel uses EasyApache the location of apxs is different so these instructions deviate somewhat from the INSTALL docs.

$ cd /usr/local/src
$ 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

Now for Ruby fcgi: You could gem install fcgi but that currently installs version 0.8.5, so we recommend compiling 0.8.6 from source as below. 0.8.6.1 is now in the gem repository.

$ gem install fcgi

You now need to edit your Apache config file. By default its (/usr/local/apache/conf/httpd.conf). Add these lines: (tweak the last line accordingly, comments are welcome)

LoadModule fastcgi_module libexec/mod_fastcgi.so
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -initial-env RAILS_ENV=production -idle-timeout 120

Make sure /tmp/fcgi_ipc/ is writable and executable by Apache.

$ mkdir -p /tmp/fcgi_ipc
$ chown nobody.nobody /tmp/fcgi_ipc -R
$ chmod 755 /tmp/fcgi_ipc -R

Now restart Apache:

$ /etc/rc.d/init.d/httpd restart

Ruby on Rails should now be successfully installed. Thank you

Bookmark Post:
  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Slashdot
  • Technorati
  • BlinkList
  • Propeller
  • Spurl
  • StumbleUpon

{ 1 comment… read it below or add one }

1 Elcoj April 30, 2009 at 4:58 PM

Hi there,
Ugh, I liked! So clear and positively.
Have a nice day

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post:

Battlefield 3