Install pg gem with PostgreSql 9.0 on Leopard
Download the installer from: http://www.enterprisedb.com/products/pgdownload.do#osx.
Install PostgreSQL, insert your password and you will have pgAdmin and other tools in your Applications directory.
If you will try to install the pg gem now you will get a compile error. You need to define the architecture of PostgreSQL and its bin directory:
sudo -s
export ARCHFLAGS='-arch x86_64'
export PATH=/Library/PostgreSQL/9.0/bin:${PATH}
gem install pg
This is the output I get:
bash-3.2# gem install pg
Building native extensions. This could take a while...
Successfully installed pg-0.9.0
1 gem installed
Installing ri documentation for pg-0.9.0...
Installing RDoc documentation for pg-0.9.0...
bash-3.2#
Labels: postgresql, ruby