After upgrade postgresql 8.1 to 9.0 ive noticed issues with libraries dependency. Postgresql works fine (connection, queries).
yum list postgresql* Installed
There are various config options you can add to the gem install, like -with-opt-dir, --with-pg-dir and --with-pg-config. Look at this mailing list thread:
-with-opt-dir
--with-pg-dir
--with-pg-config
http://www.ruby-forum.com/topic/409608