Mac OS X and ruby-postgres again

  • Thread starter Thomas Yager-Madden
  • Start date
T

Thomas Yager-Madden

Hello,

Yes I am new around here and to ruby in general. I have checked the
archive enough to know this question has come up before. I post it
again because I have tried all suggestions and have not come to a
satisfactory resolution.

I'm trying to build ruby-postgres extension under Mac OS X 10.2.6, ruby
1.6.7, PostgreSQL 7.3.3. Running extconf.rb returns the familiar error

checking for PQsetdbLogin() in -lpq... no
Could not find PostgreSQL libraries: Makefile not created

I have verified that the library file libpq.so and others mentioned in
the install note are present and with open perms. So this error message
that it cannot find the libraries it needs is confusing, to say the
least.

Any help very much appreciated.
 
T

Thomas Yager-Madden

I'm trying to build ruby-postgres extension under Mac OS X 10.2.6, ruby
1.6.7, PostgreSQL 7.3.3. Running extconf.rb returns the familiar error

checking for PQsetdbLogin() in -lpq... no
Could not find PostgreSQL libraries: Makefile not created


Now, thanks once again to everybody for the friendly, thoughtful and
helpful replies. I realize not everybody shares this problem, and much
appreciate the willingness to pitch in, especially given my newbishness.

I'm happy to report, *mystery finally solved!* :) In desparation I
tried rebuilding both PostgreSQL and Ruby itself from latest sources,
only to have ruby-postgres extension fail again with the same error
noted above.

The answer turned out to be that I had to update the compiler link table
by running ranlib of libpq.a

sudo ranlib /usr/local/pgsql/lib/libpq.a

(This was suggested by a mailing list archive in which someone had run
into a similar problem trying to build the 'psycopg' python interface
for postgresql..
http://lists.initd.org/pipermail/psycopg/2002-September/001344.html)

I tried this, and it worked like a charm. OS X, PostgreSQL, and Ruby
now all get along great on my home box! I am very thrilled.

Although I found the solution elsewhere, I don't think I would have kept
at it as long as I did, without the support from here, so thanks again.
Also, looking at the Google archive shows that this question has come up
in comp.lang.ruby at least twice before, and appears to have gone
unanswered. So, I'm not sure this comes up so often as to be
FAQ-worthy, but I bet it will come up again from somewhere, and 'ranlib
libpq.a' will be a useful bit of information to have tucked away
somewhere.

Cheers,
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,316
Latest member
naturesElixirCBDGummies

Latest Threads

Top