次の三行をヘッダにする。

 #!/bin/sh
 exec 2>&1 ruby -Ke -S -x $0 "$@" | ruby -e &#39;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)&#39;
 exit
 #! ruby

1.6でも通過するように若干修正( "....#{..."..."..}..." が パースエラーになる)