次の三行をヘッダにする。
#!/bin/sh
exec 2>&1 ruby -Ke -S -x $0 "$@" | ruby -e 'require "cgi";((a=$stdin.read) !~ /^content/i)?(puts %Q!content-type: text/html\n\n<h1>ERROR</h1><pre>#{CGI::escapeHTML("#{a}")}</pre>!):(print a)'
exit
#! ruby1.6でも通過するように若干修正( "....#{..."..."..}..." が パースエラーになる)