kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 78 forks source link

libnnz19.so: cannot open shared object file: No such file or directory #233

Closed gcjunior closed 3 years ago

gcjunior commented 3 years ago

LoadError: libnnz19.so: cannot open shared object file: No such file or directory - /home/strattix/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/ruby-oci8-2.2.9/lib/oci8lib_260.so

/opt/oracle/instantclient_19_9$ ls adrci libclntsh.so libclntsh.so.19.1 libocci.so.10.1 libociei.so sdk xstreams.jar BASIC_LICENSE libclntsh.so.10.1 libipc1.so libocci.so.11.1 libocijdbc19.so SDK_LICENSE BASIC_README libclntsh.so.11.1 libmql1.so libocci.so.12.1 liboramysql19.so SDK_README genezi libclntsh.so.12.1 libnnz19.so libocci.so.18.1 network ucp.jar libclntshcore.so.19.1 libclntsh.so.18.1 libocci.so libocci.so.19.1 ojdbc8.jar uidrvci


ruby -roci8 -e "p OCI8" Warning: NLS_LANG is not set. fallback to US7ASCII. OCI8

What should I do to fix that?

kubo commented 3 years ago

You need to set the environment variable LD_LIBRARY_PATH=/opt/oracle/instantclient_19_9. Could you check ENV['LD_LIBRARY_PATH'] in your program before require 'oci8? Note that it must be set before your program starts. ENV['LD_LIBRARY_PATH'] = '/opt/oracle/instantclient_19_9' in your program has no effect.

Otherwise, append /opt/oracle/instantclient_19_9 to /etc/ld.so.conf and run ldconfig with root privileges if your platform is Linux.


ruby -roci8 -e "p OCI8"
Warning: NLS_LANG is not set. fallback to US7ASCII.
OCI8

It works fine. I seems that LD_LIBRARY_PATH is set in the console.

gcjunior commented 3 years ago

I did that already. export LD_LIBARRY_PATH=/opt/oracle/instantclient_19_9/ echo $LD_LIBARRY_PATH /opt/oracle/instantclient_19_9/

On my IDE Rubymine I have: Environment variables: LD_LIBRARY_PATH=/opt/oracle/instantclient_19_9/

I run Selenium on Ubuntu console: java -jar ./spec/selenium_support/selenium-server-standalone-3.141.59.jar

Than on Rubymine RSpect I get the following error:

LoadError: libnnz19.so: cannot open shared object file: No such file or directory - /home/strattix/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/ruby-oci8-2.2.9/lib/oci8lib_260.so

kubo commented 3 years ago

Have you checked that LD_LIBRARY_PATH is set in your program by ENV['LD_LIBRARY_PATH']?

Otherwise, could you try the following?

Otherwise, append /opt/oracle/instantclient_19_9 to /etc/ld.so.conf and run ldconfig with root privileges if your platform is Linux.

gcjunior commented 3 years ago

@kubo Thank you so mush for your assistance. The steps that I did and solved the issue were:

cd /etc/ld.so.conf.d/ sudo vim oracle.conf #it will add this file with libraries into ld.so.conf.d oracle.conf content: /opt/oracle/instantclient_19_9 ldconfig cd ~/My-Folder-Environment java -jar ./spec/selenium_support/selenium-server-standalone-3.141.59.jar