There are many ways to do CGI with Ruby. For small tasks, I have found that erb/eruby with the
cgi module is the simplest, so that’s what I use for the rest of this section. The easiest way to get eruby working is to install
mod_ruby (and you get a speed boost, to boot!) After
mod_ruby is installed, you need to add some code to your Apache configuration to get it interpreting .rhtml files as eruby files.
<IfModule mod_ruby.c> RubyRequire apache/eruby-run <Files *.rhtml> SetHandler ruby-object RubyHandler Apache::ERubyRun.instance </Files> </IfModule>
The preceding code causes Apache to use
ERubyRun mode to parse any .rhtml file. .rhtml files are similar to ASP or PHP in that they are normal HTML files ...