i am not convinced that the instructions for postgres on the book page 321 are current.
if you look at the bottom of the page:
this project was last updated on March 29, 2009
the recommended adapter in the book is retrieved from here, correct?
which has not been modified since 2006. also, after a lot of trying, i would say is not buildable against the current version of postgres (8.3.7 atm)
also note, in the comments for ruby-pg, that the old gem “postgres” has been superseded with ruby-pg. however they are still currently maintaining the postgres gem.
also you might want to read this: http://rubyforge.org/forum/forum.php?thread_id=12577&forum_id=12690 and for those of you using ruby 1.9 http://rubyforge.org/forum/forum.php?forum_id=20348
lastly, if you are trying to install the ruby-pg gem, i found that making sure that the postgres bin directory that you are using is on the path when you install is of use… if you use non standard location for postgres. i install postgres in version specific directories eg: /usr/local/pgsql/8.3.7 vs the default /usr/local/pgsql i am guessing that it needs that to find pg_config. also the current gem should be installed as “gem install pg” not “gem install ruby-pg” which will get you the older gem… as if you had typed “gem install postgres”. hope that is clear…
so… this is what i did as root that was successful:
export PATH=/usr/local/pgsql/8.3.7/bin/:$PATH /usr/local/bin/gem install pg