Rails 1.1 / lighttpd-1.4.11 / fastcgi fuckup

some people, like me, tend to be a little slower. so if you run into the same problems after updating to rails 1.1 and your old 1.0 rails app dont work with lighttpd anymore (but instead quit with this error:)

2006-08-04 19:59:41: (mod_fastcgi.c.1022) execve failed for: public/dispatch.fcgi No such file or directory
2006-08-04 19:59:41: (mod_fastcgi.c.1048) the fastcgi-backend public/dispatch.fcgi failed to start:
2006-08-04 19:59:41: (mod_fastcgi.c.1052) child exited with status 2 public/dispatch.fcgi
2006-08-04 19:59:41: (mod_fastcgi.c.1055) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
[...]

you have to do what is being told in this bugreport and change the line in config/lighttpd.conf from

"bin-path" => "public/dispatch.fcgi",

to:

"bin-path" => CWD + "/public/dispatch.fcgi",

also this tip about the she-bang line in rails applications proved to be very useful.
Update:
Ive looked a little further, and ive come to the conclusion that when developing/deploying rails apps on multiple systems (like Mac OS X and Gentoo Linux in my case) its best to use rails with the –ruby option when generating a new app. So whenever you build your new rails app do it like this (or even use an alias):

rails --ruby="/usr/bin/env ruby" projectname

this way your apps work on most systems (as long as env installed which seems to be pretty standard) without modifiying any files like the dispatch.fcgi

Leave a Reply