sqlite3-ruby: Unable to find libsqlite3.so at runtime

L

Lars Olsson

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.


Kindly

/Lasso
 
D

david

Cit=E1t Lars Olsson said:
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.
=20
Some details on my setup:
=20
"Normal" Ruby (setup by my ISP, I don't use it) lives in /usr
(/usr/bin, /usr/lib etc.)
=20
My custom-built Ruby lives in /home/username/custom
(/home/username/custom/bin, /home/username/custom/lib etc.)
=20
My custom-built SQLite lives in /home/username/custom
(/home/username/custom/bin, /home/username/custom/lib etc.)
=20
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=3D/home/username/custom/include
--with-sqlite3-lib=3D/home/username/custom/include
The gem seems to find everything it needs to install.
=20
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.
=20
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?
=20
=20
Any suggestions help be most appreciated.
=20
=20
Kindly
=20
/Lasso
=20
=20
=20


Hmm. Being a complete newbie at things Unix, I've no idea how the dynamic=
linker
works there, but odds are you can't dlopen() a shared library without it =
being
in a well-known place. A well known place in this case being someplace in
LD_LIBRARY_PATH. Or at least not without hacking Ruby internals in this c=
ase.
Or, as a quick google would suggest, relinking Ruby to look for shared
libraries in your custom library folder.

If you mind having libsqlite3 in the environment variable all the time, u=
se a
script to temporarily set the environment variable for the ruby session, =
that
might work.

David Vallner

PS: Any information from someone -not- wildly guessing would be very much
appreciated.
 
N

nobuyoshi nakada

Hi,

At Fri, 11 Nov 2005 16:42:14 +0900,
Lars Olsson wrote in [ruby-talk:165273]:
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?

The option --enable-rpath for configure may work.
 
A

Ara.T.Howard

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

Lars Olsson

Ara.T.Howard skrev:
On Fri, 11 Nov 2005, Lars Olsson wrote:



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

*whoa* black ld magic...but it works :)

thanks for helping out!


/Lasso
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top