Just a quick pointer; hopefully it saves someone a few minutes of searching. If you want to install the Ruby native code driver for Postgres (as opposed to the pure Ruby driver, postgres-pr) and your PostgreSQL installation is in some non-standard location, just do this:
gem install postgres -- --with-pgsql-dir=/var/pgsql
Incidentally, that driver appears to have been originally written by the man himself:
Author: matz
created at: Tue May 13 20:07:35 JST 1997
And thanks to Noboru Saitou for maintaining it!