Install postgres ruby gem on leopard

My postgres is installed by macports. So it’s located in /opt/local. When I try to install postgres ruby gem (because my postgres-pr stop working), I met exceptions. And after googling some blogs, I still can’t make it works. But I think Getting PostgreSQL running for Rails on a Mac is the correct way.

So I went to /Library/Ruby/Gems/1.8/gems/pg-0.7.9.2008.10.13 folder and run:

sudo extconf.rb –with-pgsql-include-dir=/opt/local/include/postgres83 –with-pgsql-lib-dir=/opt/local/lib/postgres83

the /opt/local…postgres83 is the header folder and the lib folder of postgres installed by macports.
And after that, just do:sudo makesudo make install
And it success. Hooray!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.