Ruby
Hello World

#!/usr/local/bin/ruby --

print <<"EOM"
Content-Type: text/html; charset=shift_jis

<html><body>
Hello World!
</body></html>
EOM
exit

Content-Type: text/html; charset=shift_jisと空行一行はcgiを書く上では必ず必要です。
おまじないと思ってください。