The configuration of lighttpd is vast and complex. Here is a close to minimal configuration which allows for Perl and Ruby CGI.
server.document-root = "/opt/lighttpd/htdocs"
server.port = 3000
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
static-file.exclude-extensions = ( ".rb", ".pl", ".fcgi", ".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html" )
server.modules += ( "mod_cgi" )
cgi.assign = ( ".rb" => "/opt/ruby/bin/ruby",
".pl" => "/usr/bin/perl")