Problems installing postgres in Ruby

I just had exactly the same problem installing the ruby-postgres-0.7.1 gem,
which I -believe- is the latest version of what used to just be called the
"postgres" gem. It seemed to install, yet 'require "postgres'" failed.

I'm using Postgres 8.1 on Ubuntu 6.06. I'd previously used Postgres 8.0 on
Mandrake 10 with no problems.

Torkel, which Postgres and what OS?

Can anyone confirm my recollection that ruby-postgres is the rightful
descendant of postgres? The postgres gem itself wouldn't build on my
system, as it depends on libpq-fe.h which is apparently missing from 8.1
(or at least Ubuntu's packaging of it).

Jay Levitt

Postgres 8.1.4-1 and Fedora Core 5


Did you do "gem install postgres" or "gem install ruby-postgres" ?

I tried both. "gem install postgres" failed to build the native extension;
it depends on libpq-fe.h which is apparently gone in 8.1. "gem install
ruby-postgres", which I believe is the updated replacement for the former,
appeared to succeed but then was still "missing".

Maybe someone will have the answer...


Looks like it gets installed, but not built on my FC5 setup:

How I got it to work:

gem install postgres
cd /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/

Torkel Mathisen wrote: