From: Lyle Johnson Date: 2001-04-24T01:10:06+09:00 Subject: [ruby-talk:14084] Re: Weird problem with Ruby, Shared Libraries and Apache > I'm having a strange problem with Apache and some Ruby > modules. I just compiled the xmlparser library for my > linux box (RH 7) and wrote some XML code which from > the command line works just fine. I took the code, > popped it into the cgi-bin directory and when I run it > I get... > > :in 'require' : libexpat.so.0: cannot load shared > object file: No such file or directory - > /usr/local/lib/ruby/1.6/i586-linux/xmlparser.so > (LoadError) > > Anyone have any ideas? Again, from the command line it > works fine. It appears that the shared library that provides the xmlparser extension ("xmlparser.so") in turn depends on the Expat shared library ("libexpat.so"). Since it works OK from the command line but not within Apache, it's likely that the search path for dynamically loading shared libraries is different between those two working environments. For example, if you've installed libexpat.so in /usr/local/lib, you'd need to add that directory to the LD_LIBRARY_PATH used by Apache.