This article explains how to get Ruby on Rails to work on a http://csoft.net/ virtualhost.
ruby -v
If it is, skip the next step, otherwise:
gzcat ruby-1.8.3.tar.gz | tar -xvf -
cd ruby-1.8.3
nice ./configure --prefix=$HOME/user
nice make
nice make test
nice make install
gzcat rubygems-0.8.11.tgz | tar -xvf -
cd rubygems-0.8.11
export GEM_HOME=$HOME/user/gems
ruby setup.rb config --prefix=$HOME/user
ruby setup.rb setup
ruby setup.rb install
gem install rails --include-dependencies --no-rdocgem install fcgi --no-rdoc -- --with-fcgi-dir=/usr/local
PATH=$HOME/user/bin:$HOME/user/gems/bin:$PATH
export PATH
GEM_HOME=$HOME/user/gems
export GEM_HOME
Log out and back in or just cut&paste the commands above into your shell to update your environment.
which ruby # should point to the ruby in $HOME/user
ruby -v # should be at least 1.8.2
gem environment # installation directory and gem path should point to $HOME/user/gems
cd ~/www/YOURWEBHOST
rails railstest # generate a ruby on rails structure
cd railstest
./script/generate controller test # generate a test controller
Options +FollowSymLinks +ExecCGI
# we don't need to add handlers for FastCGI, thats alread in csoft's global httpd.conf
RewriteEngine On
# add this line
RewriteBase /railstest/public
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# change dispatch.cgi to dispatch.fcgi so we use FastCGI (CGI works too, but it's painfully slow)
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
#!/YOUR/HOME/user/bin/ruby
ENV['GEM_HOME'] = '/YOUR/HOME/user/gems' # adjust this - so rubygems can find the gems
require 'rubygems' # this is so the fcgi_handler includes the fcgi gem instead of looking for fcgi in site-ruby, which we didn't install