Installing do_postgres on MacPorts
Ensure that pg_config is in your $PATH.
Note: This expects you are using PostgreSQL 8.2. Alter the directories as required.
To test if pg_config is included, execute which pg_config
:
Expected Result:
/opt/local/lib/postgresql82/bin/pg_config
Including pg_config into your $PATH
If you don’t get anything, then it isn’t in your path. Append the following to your ~/.profile file:
export PATH=$PATH:/opt/local/lib/postgresql82/bin
Now it will be included in all new terminal sessions.
Installing do_postgres
Now feel free to install the do_postgres gem.
sudo gem install do_postgres -- --with-pgsql-include-dir=/opt/local/include/postgresql82/ --with-pgsql-lib-dir=/opt/local/lib/postgresql82/
Note: This is a single line command.



Peter M. said,
January 16, 2008 @ 5:01 am
Thanks a mil - that worked a treat. About to dive into merb…. here goes!
Bob Aman said,
May 3, 2008 @ 2:00 am
Your command didn’t work for me, but this did:
sudo gem install do_postgres-0.9.0.gem — –with-pgsql-include=/opt/local/include/postgresql82/ –with-pgsql-lib=/opt/local/lib/postgresql82/