Here is the easiest process I have found for setting up
Ruby and
PostgreSQL on OS X Leopard at this time.
I recommend
PostgreSQL for Mac instead of fink as it is more actively maintained and easier to install. Note that when downloading, use the alternate download not the Sourceforge links, as the Sourceforge download is not current and has issues. This installer places the PostgreSQL CLI commands in
/Library/PostgreSQL8/bin/
and will auto-start PostgreSQL on system startup. It includes some graphical tools, but I recommend ignoring them and and installing
pgAdmin III if you want an administration GUI (I usually just use the CLI tools).
Ruby has a couple PostgreSQL gems, I recommend
ruby-pg which appears to be the only one actively maintained. The easiest way to get it installed is to download the latest .gem, then run the following command to install it in the directory where you saved it (replace the version number as necessary):
PATH=$PATH:/Library/PostgreSQL/bin/ gem install pg-0.7.9.2008.02.05.gem
Don't waste your time trying to find documentation for this gem online, point your browser at the documentation on your local machine, which for this version was at:
file:///Library/Ruby/Gems/1.8/doc/pg-0.7.9.2008.02.05/rdoc/index.html