Setting the Relative Url Path in Ruby on Rails

The Problem

You're using apache with fastcgi and you can access the "you're running rails" page at the but can't get to any of my controllers at , getting 500 errors instead.


The Solution

In environment.rb set the following at the bottom:


ActionController::AbstractRequest.relativeurlroot = '/myrailsapp'

If that fails, I recommend trying it with mongrel webserver which has been known to fix whis problem for many.