The unending joy of compiling ruby-postgres under Mac OS X

  • Thread starter Thomas Yager-Madden
  • Start date
T

Thomas Yager-Madden

Seems like I've been here before; now I'm enjoying it with upgraded
versions of everything.

Under OS X.3.5, have compiled and built Ruby 1.8.1 and PostgreSQL
7.4.5, and both are working fine.

Based on previous experience, executed ranlib against pgsql library
archive libpq.a before attempting to compile ruby-postgres extension.
Appeared to have success with extconf.rb, make, and install of
ruby-postgres, which all ran without error or complaint.

Any attempt to run Ruby code with `require "postgres"` however, returns
error "dyld: ruby Undefined symbols:" and complete list of all symbols
in libpq.

Any suggestions or reports from anybody who got this working in similar
environment much appreciated.
Thanks,
Thomas Yager-Madden
http://syntactician.com
 
A

Ara.T.Howard

Seems like I've been here before; now I'm enjoying it with upgraded
versions of everything.

Under OS X.3.5, have compiled and built Ruby 1.8.1 and PostgreSQL
7.4.5, and both are working fine.

Based on previous experience, executed ranlib against pgsql library
archive libpq.a before attempting to compile ruby-postgres extension.
Appeared to have success with extconf.rb, make, and install of
ruby-postgres, which all ran without error or complaint.

Any attempt to run Ruby code with `require "postgres"` however, returns
error "dyld: ruby Undefined symbols:" and complete list of all symbols
in libpq.

Any suggestions or reports from anybody who got this working in similar
environment much appreciated.
Thanks,

BEFORE you compile the ruby-postgres binding do something like

~ > export LD_RUN_PATH=/full/path/to/postgresql/lib/

~ > ruby extconf.rb && make clean && make && sudo make install

this will encode the paths to the postgresql lib (a dependancy that is
resolved at run time) into the ruby postgresql lib. you should be able to see
this with

~ > ldd postgres.so

which should show the paths to your postgresql installation. this last bit
might not work on mac but the the compile should.

you can test this before recompiling with

~ > export LD_LIBRARY_PATH=/full/path/to/postgresql/lib/
~ > irb -r postgres

which should work even now.

do a man ld.so for more info.

kind regards.

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
 
T

Thomas Yager-Madden

Ara,

Bless you, that was just the ticket. All is joyous and
ruby-postgresquelish now.

- Thomas
 
T

trans. (T. Onoma)

On Wednesday 06 October 2004 05:49 pm, Thomas Yager-Madden wrote:
| Ara,
|
| Bless you, that was just the ticket. All is joyous and
| ruby-postgresquelish now.
|
| - Thomas

Thomas, I have a rubygem for Ruby-Postgres. Works fine for Linux, but I have
never been able to try for Mac. Mr. David Heinemeier Hansson was very
interested in this, but never got back to me on whether it worked or not.
With your new found "ticket" would you mind taking a look and seeing if you
could get it working. That would make a lot of folks happy me thinks.

T.
 
T

Thomas

Thomas, I have a rubygem for Ruby-Postgres. Works fine for Linux, but I
have never been able to try for Mac. Mr. David Heinemeier Hansson was
very interested in this, but never got back to me on whether it worked
or not. With your new found "ticket" would you mind taking a look and
seeing if you could get it working. That would make a lot of folks
happy me thinks.

T.-

Since I'm just trying stuff out here for the most part, I'd be happy to
take your package for a spin, but I'll need a little more information
how to get it. I just tried a regular "gem install ruby-postgres" and
got result " Could not find ruby-postgres (> 0) in the repository"

So, if you can get me pointed the right way, I'll see what I can do.
Meanwhile, I have Ruby-DBI w/ pg-dbd working now, as well as
ruby-postgres, so I'm a lot happier than I was this morning.

Two weird compile difficulties solved in one day. This is a great newsgroup :)

- Thomas
 
T

trans. (T. Onoma)

On Wednesday 06 October 2004 10:04 pm, Thomas wrote:
| Since I'm just trying stuff out here for the most part, I'd be happy to
| take your package for a spin, but I'll need a little more information
| how to get it. I just tried a regular "gem install ruby-postgres" and
| got result " Could not find ruby-postgres (> 0) in the repository"
|
| So, if you can get me pointed the right way, I'll see what I can do.
| Meanwhile, I have Ruby-DBI w/ pg-dbd working now, as well as
| ruby-postgres, so I'm a lot happier than I was this morning.

No problem. I have it. I will send it to you with instructions. Just give me a
few days as I am pretty busy at the moment. If you get a moment though, and
haven't already done so, you may want to read up on how to build a Gem --it's
pretty straightforward actually.

Thanks!
T.
 

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,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top