From: "Ara.T.Howard" Date: 2005-08-02T10:43:54+09:00 Subject: Re: extconf.rb search path On Tue, 2 Aug 2005, Joe Van Dyk wrote: > On 8/1/05, Ara.T.Howard wrote: >> On Tue, 2 Aug 2005, Joe Van Dyk wrote: >> >>> Hi, >>> >>> Whenever I run extconf.rb for gnome2, it compiles against the gnome >>> libraries found in /usr. I want it to compile against the gnome >>> libraries found in /usr/local. Isn't that what it should do by >>> default? >>> >>> Anyways, how can I get the gnome2 Ruby extensions to compile against >>> the headers/libraries in /usr/local? >>> >>> Thanks, >>> Joe >> >> try this >> >> ~ > LD_LIBRARY_PATH=/usr/local:$LD_LIBRARY_PATH LD_RUN_PATH=/usr/local:$LD_RUN_PATH ruby extconf.rb >> >> perhaps your compiler will like this... >> >> probably there is also a >> >> --with-gnome-dir=/usr/local >> >> option for that extconf. >> >> -a >> -- > > Weirdly, if I run /usr/local/bin/ruby (and not /usr/bin/ruby) on > extconf.rb, it uses libraries/headers in /usr/local (and not /usr). > > So, part of it seems to depend on where Ruby is installed. absolutely - you should always be aware of which ruby you are using to compile extensions. basically ruby caches tons of stuff when it's compiled itself. it stores all this info and this is the foundation of 'mkmf', which extconf.rb uses. this should be illuminating: ruby -r rbconfig -r yaml -e 'y Config::CONFIG' if you're using the 'right' ruby you should see a /usr/local or two in there. another rule of thumb: unless you understand why you wouldn't do so - always set LD_RUN_PATH to your system libdir (for example /usr/local/lib) when compiling extensions. this is __very__ important in the case of ruby libs which themselves require libs : for example sqlite or gnome. if you don't set this you'll have issues at runtime with the gnome-ruby libs loading gnome libs from /usr/lib/ vs. /usr/local/lib. run ldd on the ruby-gnome extension to see what i mean. if you re-compile with LD_RUN_PATH set to /usr/local you'll see a difference. btw my command above should have been ~ > LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH LD_RUN_PATH=/usr/local/lib:$LD_RUN_PATH ruby extconf.rb cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================