#!/usr/local/bin/ruby # erb.cgi # # Apache script handler for .rhtml files # based on work by Brian Bugh and Paul McArdle # see http://dekstop.de/weblog/2006/01/rhtml_on_osx_with_apache_and_erb/ # # Martin Dittus (martin@dekstop.de), 2006-01-09 # last change: 2006-01-11 require 'time' require 'erb' time = Time.now.httpdate HEADERS = <Script Error" print "
#{ $! }
" # debug info print "

Backtrace

" print "
#{$!.backtrace.join("\n")}
" print "

Environment

" print "
#{ENV.keys.map { |key| key + ' = ' + ENV[key] + "\n"} }
" print "
" print "#{__FILE__} -- #{time}" end