> ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include \
> --with-pgsql-lib-dir=/usr/local/pgsql/lib
>
> ...but I still get the same error that it can't find the postgres libs,
> although I have verified that the libraries in question are present in
> the specified location.

Try adding
--with-ldflags="-L /usr/local/pgsql/lib"

That will tell the linker to look in the sql folder for the libraries 
as well.

Alternatively, you could symbolic link the libpq file into /usr/lib

Scott