cannot open shared object file

I got this error starting a ruby application:

/usr/local/rvm/gems/ruby-1.9.3-p547/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require': cannot open shared object file: 
No such file or directory - 
/usr/local/rvm/gems/ruby-1.9.3-p547/extensions/x86_64-linux/1.9.1/ibm_db-2.5.11/ (LoadError)

An .so is a Linux library, equivalent to a .dll on Windows or a .dylib on Mac. Note that there are two different libraries mentioned. is present, while is missing.

You can verify the dependencies using the ldd command:

$ ldd /usr/local/rvm/gems/ruby-1.9.3-p547/extensions/x86_64-linux/1.9.1/ibm_db-2.5.11/ =>  (0x00007fff93545000) => /usr/local/rvm/rubies/ruby-1.9.3-p547/lib/ (0x00007fb8ba5a5000) => not found => /lib64/ (0x00007fb8ba37f000) => /lib64/ (0x00007fb8ba177000) => /lib64/ (0x00007fb8b9f72000) => /lib64/ (0x00007fb8b9d3b000) => /lib64/ (0x00007fb8b9ab7000) => /lib64/ (0x00007fb8b9722000)
    /lib64/ (0x0000003730400000) => /lib64/ (0x00007fb8b94ab000)

For me, the issue was caused by a missing IBM Data Server Driver directory. IBM_DB_LIB was pointing to a non-existent directory:

$ set | grep IBM

Reinstalling the Data Server Driver restored the and eliminated the error.

(If you run into this issue with different libraries, you will likely need to examine your LD_LIBRARY_PATH environment variable and use the ldconfig command to reload any changes.)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.