The Passionate Craftsman

Ruby, PHP, MySql, Software engineering and more.

Friday 24 September 2010

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: ,

1 Comments:

At 20 January 2011 at 12:32 , Anonymous Anonymous said...

You saved my day! My Hero!!!

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home