From: Thomas Yager-Madden Date: 2003-08-28T17:43:11+09:00 Subject: Re: Mac OS X and ruby-postgres again Thanks again to everyone for trying to help with this! Of the various suggestions so far, this last has come closest to working. Various suggestions (passing different parameter flags to the extconf, changing env variables, symlinking the postgresql libs from other paths) for getting extconf.rb to recognize my libpq and other PostgreSQL library files all lead to the same result, that "have_func" will not believe I have the libraries it wants, even though the libraries in question appear, by any other lights, to be *right there*. But if I stop it from checking for them (ie comment out all the "if...have_func" lines, it will of course go ahead and create makefile. At first, submitting this to 'make' errors out -- which I would expect, since the makefile isn't really set up to link properly. But I have managed to edit the makeflie, adding "-I/usr/local/pgsql/include" to the CPPFLAGS line, and "-L/usr/local/pgsql/lib" to LIBPATH. At which point it appears to allow me to 'make' and 'make install' without error. However, any attempt to run actual ruby code using "require 'postgres'" (e.g. 'test1.rb' from the /samples that ship with the extension) although it seems to load the module successfully (that is, I don't get a not found error for 'postgres' itself) then returns dyld: ruby Undefined symbols: _PQclear _PQcmdStatus _PQcmdTuples _PQconsumeInput _PQdb ..... (I'm guessing this list of undefined symbols, which is lengthy, is all the methods in libpq.) So, I feel like I'm getting closer, but still no cigar. Any thoughts/suggestions? I'm at a loss. I'd really like to get this working, though. - Thomas In article , Scott Thompson wrote: > > I have tried specifying library path when invoking extconf.rb, using > > this syntax: > > > > ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include \ > > --with-pgsql-lib-dir=/usr/local/pgsql/lib > > > > ...but I still get the same error that it can't find the postgres libs, > > although I have verified that the libraries in question are present in > > the specified location. > > Another solution would be to edit the extconf.rb file, remove the > "have_func" calls that are preventing it from creating the make file, > create the makefile, and deal with linker errors that come up from the > make by editing the makefile. > > Scott > >