On 9/20/06, zerohalo <zerohalo / gmail.com> wrote:
> [snip]
>
> > If the former, you can tell Apache to serve Ruby scripts that contain the
> > usual CGI conventions. That seems simple enough. And it might not be what
> > you are asking for.
>
> That's the part I'm missing. I find Apache extremely difficult to
> configure (beyond the basics). How would I tell Apache to serve Ruby
> scripts?

On Debian and Ubuntu, it just works. After you apt-get install
apache2, you just copy some foo.rb file (maybe like the one shown
below) to /usr/lib/cgi-bin/ and then point your browser at
http://localhost/cgi-bin/foo.rb and boom. :)

==== snip /usr/lib/cgi-bin/foo.rb ====
#!/opt/ruby/bin/ruby -w

puts "Content-type: text/html"
puts

puts "<html><body>
<p>The time is now #{Time.now}, so you'd
better get crackin'!
</p>
</body>
</html>"
==== /snip ====

---John