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
===============================================================================