From: Dan Debertin Date: 2002-05-24T22:35:09+09:00 Subject: Re: cannot require 'postgres' from cgi ahoward writes: > turns out (this took me a LONG time to determine) that the postgres.so lib has > dependancies on other libs which are not to be found in the LD_LIBRARY_PATH > (empty) of the default cgi environment but that WERE found in my own > LD_LIBRARY_PATH. I had the same problem. Solaris, right? Rather than mucking with LD_LIBRARY_PATH (which is an egregious hack anyway), I figured out how to set the RUN_PATH during compilation. For ruby itself, there's an $LDFLAGS global in ext/extmk.rb around line 555 that you can add "-R/usr/local/lib" to. The Postgres module should have something similar, though I've not compiled it. Incidentally, it was kind of annoying that Ruby wouldn't take LDFLAGS from my environment like every other package does. Usually one of the following does the trick on Solaris: make LDFLAGS=-R/usr/local/lib LDFLAGS=-R/usr/local/lib ./configure ...... But with ruby I had to grovel through the build scripts looking for the right variable. > > it's a little troublesome that 'require' is unable to throw for this sort of > error... It's not ruby's fault ;). It's the OS's runtime linker. Dan -- airboss@nodewarrior.org www.nodewarrior.org ignorami: n: The art of folding problem users into representational shapes.