From: huiliang wu Date: 2006-07-10T17:35:01+09:00 Subject: Re: How does ruby load a shared library ------=_Part_64875_13223306.1152520497917 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I set LD_LIBRARY_PATH using export LD_LIBRARY_PATH=/foo and it works. Now I want to set environment variable in my ruby script, so I use ENV['LD_LIBRARY_PATH'] = "/foo", but this time it doesn't work. What's difference between using ENV in script and export in the linux shell? Thanks in advance! On 6/17/06, John Gabriele wrote: > > On 6/16/06, huiliang wu wrote: > > Hi, > > I created an c extension which is linked with another shared library > named > > libfoo.so. > > When I use this extension in ruby script, it evoke an error message: > > ./demo.rb:3:in 'require': libfoo.so: cannot open shared object file: No > such > > file or directory > > > > If I move libfoo.so to /usr/lib, it works. > > Is ther any other ways to deal with such problem? As I don't want to put > the > > library into /usr/lib or set the LD_LIBRARY_PATH. > > Thanks in advance! > > > > If you're on GNU/Linux, maybe this article will help: > http://wiki.linuxquestions.org/wiki/Library-related_Commands_and_Files > > ---John > > ------=_Part_64875_13223306.1152520497917--