New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use OCI_INC_DIR and OCI_LIB_DIR instead of *LD_LIBRARY_PATH #89
Comments
Hi Milaniliev, Kind regards, |
I ended up having to disable SIP on OS X using the Recovery Partition and Hope that helps.
|
Updated at 2015-09-17. The followings are not changed. The Oracle library $ otool -L libclntsh.dylib.11.1
libclntsh.dylib.11.1:
/ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
/ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
So I think out two ways.
Use DYLD_FALLBACK_LIBRARY_PATHThe default value of DYLD_FALLBACK_LIBRARY_PATH is export DYLD_FALLBACK_LIBRARY_PATH=$HOME/lib:/usr/local/lib:/lib:/usr/lib:/opt/oracle/instantclient_11_2 Fix dependent Oracle library pathsUse fix_oralib.sh. If libclntsh.dylib.11.1 in in /opt/oracle/instantclient_11_2, run the following commands cd /opt/oracle/instantclient_11_2
curl -O https://gist.githubusercontent.com/kubo/8b3627c57091872a09b6/raw/fix_oralib.sh
sh fix_oralib.sh And then search locations of for path in `gem environment gempath | tr -s ':' ' '`; do test -d $path/gems && find $path/gems -name "oci8lib_???.bundle"; done Run the following command at the each location of sh /opt/oracle/instantclient_11_2/fix_oralib.sh --lib-dir=/opt/oracle/instantclient_11_2 This script fixes dependent Oracle library paths as follows: $ otool -L libclntsh.dylib.11.1
libclntsh.dylib.11.1:
/opt/oracle/instantclient_11_2/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
/opt/oracle/instantclient_11_2/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) |
@milaniliev the following is not true.
These environment variables are used during node-oracledb at install time only. Runtime still needs DYLD_LIBRARY_PATH. |
You're right, my apologies. I guess Oracle needs to fix this also.
|
@milaniliev fix in what way? (PS I am Oracle) |
@cjbj Wow, then double-thanks for your response. My understanding is that Apple's default security setup in El Capitan prevents modifications to DYLD_LIBRARY_PATH, and strongly discourages disabling that feature. (The process currently involves booting into the recovery partition.) I am not familiar with C programming; is setting an env variable at runtime the only way to build software that relies on third-party libraries? If so, do you know if Apple has provided guidance to C programmers on what the recommended approach for this scenario is? I apologize for not being able to offer an actual suggestion here, I'm a little out of my depth. I'll do more research on this in the next few days and share anything useful. |
I installed OS X 10.11 El Capitan (by deleting Linux partition...) and fixed the installation issue. If Oracle instant client is installed in the default path of $ git clone --depth=1 https://github.com/kubo/ruby-oci8.git
$ cd ruby-oci8
$ gem build ruby-oci8.gemspec # create a gem file
$ gem install ./ruby-oci8-2.2.0.gem # install the created gem file If Oracle instant client is outside of the default path of $ cd /opt/instantclient_11_2 # if instant client packages were unzipped under /opt
$ curl -O https://raw.githubusercontent.com/kubo/fix_oralib_osx/master/fix_oralib.rb
$ ruby fix_oralib.rb
$ cd # changed to other directory
$ git clone --depth=1 https://github.com/kubo/ruby-oci8.git
$ cd ruby-oci8
$ gem build ruby-oci8.gemspec # create a gem file
$ export OCI_DIR=/opt/instantclient_11_2 # set the instant client location
$ gem install ./ruby-oci8-2.2.0.gem The created gem file's version number is 2.2.0, which is the next version released in a few weeks. |
Nice! Do you have this documented in the README? If not, would you like
|
@milaniliev |
2.2.0 saved my day.Txs |
Ruby-oci8 2.2.0 was released. It supports OCI_DIR on OS X. |
Hello, I have been trying to install Oracle Client on El-Capitan, sadly i am running into some problems. The error messages i get are, Error Message: Set the environment variable DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH or OCI_DIR to point to the Instant client directory.
Please help me to solve the problem Thanks Deepesh
|
Deepesh, Try setting the OCI_LIB env variable to the full path to the Oracle Instant On Sun, Jan 31, 2016 at 1:14 PM DeepeshKr notifications@github.com wrote:
|
Hello Milan, To set the OCI_LIB env variable to the full path to the Oracle Instant export PATH=$PATH:~/opt/oracle/instantclient_11_2 Sadly this doesn't seem or should add a line to bash_profile I also tried $ ruby fix_oralib.rb --absolute-path (response is given below) Please share the baby steps with me on this, sorry to bother you on this, Thanks for all your help Regards Deepesh --- i got the following --- genezi: libclntsh.dylib: libnnz11.dylib: libocci.dylib.11.1: libociei.dylib: libocijdbc11.dylib: libsqlplus.dylib: libsqlplusic.dylib: sqlplus: uidrvci: On Mon, Feb 1, 2016 at 12:34 AM, Milan Iliev notifications@github.com
|
|
Deepesh, What @kubo said. "export PATH" sets the PATH env variable; you want to set Read up on "UNIX environmental variables" on the internet when you have On Mon, Feb 1, 2016 at 6:02 AM, Kubo Takehiro notifications@github.com
|
Hello Milan, I was able to solve my problem, thanks for all your help and taking time out to reply Best Deepesh
|
Thanks Kubo, this helped me a lot to solve me problem Best Deepesh
|
I am also having issues installing ruby-oci8. I am running El Capitan and have followed all the instructions listed on this thread. I get the same error as Deepesh with the exception of after "DYLD_FALLBACK_LIBRARY_PATH is not set." I have the following: checking OCI_DIR... The dependent shared library paths are checked and the check does not pass. What is the checking doing? And is there anyway that I can resolve this? |
Did you set the OCI_DIR environmental variable to the path to your local On Sun, Feb 28, 2016 at 11:49 PM joelvega notifications@github.com wrote:
|
Yes I did, using: And I can see that it worked correctly by using the following command: |
@joelvega
If the environment variable OCI_DIR is set as /opt/oracle/instantclient_11_2, the next line of |
@kubo
Could you clarify the bolded? I have tried to install ruby-oci8 many times now, so I'm not sure what this means. The attached pdf shows my attempt after closing all previous terminal sessions and starting a new terminal session. *Note, I did move instantclient_11_2 from /opt/oracle to /opt to match your post exactly, just in case there is any confusion. |
Could you check environment variables under
If it prints nothing, OCI_DIR is unset in
|
@kubo, thank you
I have tried |
The sudo command may not preserve the caller's environment variables.
|
Hi kubo,
Thank you for ruby-oci8! It's awesome.
I'm running 2.1.8 on the OS X El Capitan beta, and the new security config for upcoming versions of OS X will enable "rootless" mode (System Integrity Protection), which prevents any changes to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH for security reasons.
It is possible to disable rootless mode, but obviously this is not good practice.
I wanted to ask, Oracle's NodeJS driver uses the following environmental variables:
OCI_LIB_DIR instead of (DY)LD_LIBRARY_PATH
OCI_INC_DIR instead of (DY)LD_LIBRARY_PATH/sdk/include
These are unaffected by the new security settings.
Is it possible to change ruby-oci8 to look at those env vars in addition to / instead of *LD_LIBRARY_PATH? That way best practice will be followed, and it will require people using both Node and Ruby drivers to only set up one set of variables.
Let me know if I can do anything to help with this.
Thanks again,
Milan Iliev
The text was updated successfully, but these errors were encountered: