there is no cpaddon module for rails, so you gotta get your hands dirty. This is the fast way I got it to run, I will makes notes where needed. This is current as of August 2006 with the latest “stable” cpanel WHM.

As the root user, install ruby, gems, rails, fcgi, mod_fastcgi and add a configuration line to http.conf and restart as follows ( condensed from: here):

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

$ cd /usr/local/src
$ wget rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
$ tar -xvzf rubygems-0.8.11.tgz
$ cd rubygems-0.8.11
$ ruby setup.rb

$ gem install rails

$ 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

$ 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

$ gem install fcgi

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

Then in /etc/httpd/conf/httpd.conf add

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

install any other gems you want like rmagick and gettext and then restart apache however you like.. Remember if you install a gem you must restart apache to be able to use it.

Now to actually get rails running, follow what I have done with this domain use your own user

$ su people
$ cd ~
$ rails test
$ cd public_html
$ ln -s ../test/public/ rails
$ cd ../test/
$ chmod -R 777 tmp/
$ cd public
$ chmod 755 dispatch.fcgi
$ vim .htaccess

chmod -R a+rwx tmp is probably better than 777, but it is an afterthought to just getting this done

Change “dispatch.cgi” to “dispatch.fcgi”

Load up http://peoplesdns.com/rails/

One of the main issues I have seen from people is that they get it running but if the tmp directory is not writable then rails pukes and gives a bunch of errors, this seems to fix the issue.

An easy way to make rails standards would be to wrap /usr/bin/rails in a shell script by renaming rails to “runrails” and then having the rails script handle this, along with setting a “_RAILS” dir in the users folder and creating all projects inside that.

if you want to use mysql (duh)
gem install mysql

if you don`t do the above, rails doesn`t panic it starts spitting out “Lost connection to MySQL server during query” errors all over which really tells you nothing.. so make sure and install the mysql gem and save yourself some headaches.

install whatever other gems you want
Then if you actually want to use your gems, you must
/etc/init.d/httpd restart
it is sort of like installing anything on windows, you gotta reboot the whole thing.

Anyway, though that might come in handy for someone.