install do_postgres on OSX Leopard
March 3rd, 2010
Install notes for Datamapper do_postgres driver ruby gem on severall operating systems:
Apple OSX Snow Leopard
System Version: Mac OS X 10.6.2
Kernel Version: Darwin 10.2.0
(No Macports; No Homebrew)
PosgreSQL 8.4
I wanted to have PosgreSQL server working on the mac so that development is easier.
There is a .dmg package from the guys at EnterpriseDB that is a single click install. Check it at their downloads page. Get it. Install it. Everything goes into:
/Library/PostgreSQL/8.4
Now to install the do_postgres gem, I had to set the $PATH to:
$ export PATH=$PATH:/Library/PostgreSQL/8.4/bin
Now, installing the gem from rubygems.org should work:
$ gem install do_postgres
or
sudo env ARCHFLAGS='-arch i386' gem install do_postgres
Remember in OSX where your gems are installed, with or without root access using:
$ gem environment
Debian 5.0 Lenny
I have PosgreSQL 8.3 on my Debian servers, from the repositories. To install the do_postgres gem, you must get the header files for libpq5 (PostgreSQL library):
$ sudo apt-get install libpq_dev
$ sudo gem install do_postgres
Ubuntu 9.10 Karmic Koala
I have PosgreSQL 8.4 on my Ubuntu servers, from the repositories. To install the do_postgres gem, you must get the header files for libpq5 (PostgreSQL library):
$ sudo apt-get install libpq_dev
$ sudo gem install do_postgres
lest said:
I got errors on Show Leopard after installing do_postgres according your instructions:
dyld: lazy symbol binding failed: Symbol not found: _PQsetdbLogin
Referenced from: /Users/lest/.rvm/gems/ruby-1.9.1-p378/gems/do_postgres-0.10.1/lib/do_postgres/do_postgres.bundle
Expected in: flat namespace
dyld: Symbol not found: _PQsetdbLogin
Referenced from: /Users/lest/.rvm/gems/ruby-1.9.1-p378/gems/do_postgres-0.10.1/lib/do_postgres/do_postgres.bundle
Expected in: flat namespace
do you know how fix them?
pedro said:
Hi lest,
you are using Ruby 1.9, my post was related to 1.8.7.
Please try it via homebrew using my latest post, here http://blog.tquadrado.com/?p=215
Jeena Paradies said:
Hi,
it is called libpq-dev not libpq_dev.