http://www.coolnamehere.com/geekery/ruby/web/cgi.html
http://www.rubycentral.com/book/web.html
etc

you can also learn to use databases with ruby, without rails...
see a recent post on that