FastCGI and Rails

I have been trying to set up my rails app on Dreamhost for a while now.

I’ve made sure all my dispatch.* files and the public directories are chmod 755, I have set the ENV[‘RAILS_ENV’] ||= ‘production’ in environment.rb, I have changed the .htaccess to use dispatch.fcgi instead of dispatch.cgi, I have checked that things work using script/console and things work fine using Webrick.

And I still can’t get rid of this FastCGI error: FastCGI: incomplete headers (35 bytes) received from server “/path/to/dispatch.fcgi”. Running dispatch.fcgi on the command line yields a 500 error. There is nothing in production.log and fastcgi.crash.log says stuff like “starting”,“asked to terminate immediately”,“terminated by explicit exit”.

Does anyone have any ideas? Please?

try running dispatch.rb straight from the command line… see if that is throwing any kind of exception…

DevelopStuff -

Doesn’t look very promising:

$ ./dispatch.rb
Status: 500 Internal Server Error

Make sure it has the proper line-endings. You may need to use dos2unix on it.

  • Dallas
  • DreamHost Head Honcho/Founder

Thanks Dallas, but I don’t use Windows… no DOS line endings issues there…

Things are a bit different now than before though, as I only get the Application Error intermitently. Sometimes it works, sometimes it doesn’t… Weird