From: "Ara.T.Howard" Date: 2005-11-11T23:12:14+09:00 Subject: Re: sqlite3-ruby: Unable to find libsqlite3.so at runtime On Fri, 11 Nov 2005, Lars Olsson wrote: > Hi, I've custom-built both Ruby and SQLite on a shared Debian box but > I'm having some problems getting sqlite3-ruby to work correctly. It > seems to install OK, but the lib seems unable to find libsqlite3.so at > runtime. > > Some details on my setup: > > "Normal" Ruby (setup by my ISP, I don't use it) lives in /usr > (/usr/bin, /usr/lib etc.) > > My custom-built Ruby lives in /home/username/custom > (/home/username/custom/bin, /home/username/custom/lib etc.) > > My custom-built SQLite lives in /home/username/custom > (/home/username/custom/bin, /home/username/custom/lib etc.) > > When I install sqlite3-ruby as a gem I have specified the location of > the sqlite3 headers and libs > gem install sqlite3-ruby --remote -- > --with-sqlite3-include=/home/username/custom/include > --with-sqlite3-lib=/home/username/custom/include > The gem seems to find everything it needs to install. > > At runtime, sqlite3-ruby cannot find libsqlite3.so unless I explicitly > set the LD_LIBRARY_PATH environment variable to point at > /home/username/custom/lib. > > Is it possible to let sqlite3-ruby know where to find libsqlite3.so > without using LD_LIBRARY_PATH? Is it possible to set it > when compiling Ruby or installing the gem? > > > Any suggestions help be most appreciated. all you need to do is export LD_RUN_PATH=/home/username/custom/lib __before__ compiling and you'll not need to use LD_LIBRARY_PATH. in general, if installing into a non-standard place like that, follow these instructions for __everything__ that you compile export LD_RUN_PATH=/home/username/custom/lib:$LD_RUN_PATH export LD_LIBRARY_PATH=/home/username/custom/lib:$LD_LIBRARY_PATH ./configure --prefix=/home/username/custom && make && make install anyone who does this for ruby, extensions, and other libraries will by suprised to find that everything just works - no matter what platform you are on or what package manager might exist. regards. -a -- =============================================================================== | ara [dot] t [dot] howard [at] gmail [dot] com | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ===============================================================================