Five Pounds of Flax

Every culture has a burrito.

Fedora Core 4, Apache2, Ruby on Rails and FastCGI

Thursday, April 27, 2006posted by Michael Rothwell @ 10:33 PM

FastCGI (or in my case, mod_fcgid plus the FastCGI dev kit) runs the script public/dispatch.fcgi in your Rails application. If you're having problems getting it to run right, try this.

The dispatch.fcgi script normally looks like this:

#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!
Edit it so that it looks like this:
#!/usr/bin/ruby
require File.dirname(__FILE__) + "/../config/environment"
FCGI_PURE_RUBY = true
require 'fcgi_handler'

RailsFCGIHandler.process!

That one change might make it work right for you.