Skip to content
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

Closed
ghost opened this issue Jul 31, 2015 · 27 comments
Closed

Use OCI_INC_DIR and OCI_LIB_DIR instead of *LD_LIBRARY_PATH #89

ghost opened this issue Jul 31, 2015 · 27 comments

Comments

@ghost
Copy link

ghost commented Jul 31, 2015

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

@xtr3me
Copy link

xtr3me commented Aug 11, 2015

Hi Milaniliev,
Did you manage to install ruby-oci8 or are you waiting for a fix from Kubo?
I also can't install ruby-oci8 so i'm hoping for a quick workaround or a proper fix :)

Kind regards,
Sjors

@ghost
Copy link
Author

ghost commented Aug 12, 2015

I ended up having to disable SIP on OS X using the Recovery Partition and
then installed it like normal. Obviously not an ideal solution, but it
should work if you're using El Capitan. (Assuming your only problem was not
being able to set DYLD_LIBRARY_PATH.)

Hope that helps.
On Tue, Aug 11, 2015 at 8:58 AM xtr3me notifications@github.com wrote:

Hi Milaniliev,
Did you manage to install ruby-oci8 or are you waiting for a fix from Kubo?
I also can't install ruby-oci8 so i'm hoping for a quick workaround or a
proper fix :)

Kind regards,
Sjors


Reply to this email directly or view it on GitHub
#89 (comment).

@kubo
Copy link
Owner

kubo commented Aug 20, 2015

Updated at 2015-09-17.
I dropped a partition used for Linux on my mac book air and installed the El Capitan beta instead.
All ways under the following horizontal rule doesn't work.


The followings are not changed.

The Oracle library libclntsh.dylib.11.1 has full paths of depended libraries as folows:

$ 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)

libclntsh.dylib.11.1 tries to use libnnz11.dylib in DYLD_LIBRARY_PATH. If it fails, it tries to use
embedded path /ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib and then use libnnz11.dylib in DYLD_FALLBACK_LIBRARY_PATH.

So I think out two ways.

  1. Use DYLD_FALLBACK_LIBRARY_PATH
  2. Fix dependent Oracle library paths

Use DYLD_FALLBACK_LIBRARY_PATH

The default value of DYLD_FALLBACK_LIBRARY_PATH is $HOME/lib:/usr/local/lib:/lib:/usr/lib according to dyld(1).
If libclntsh.dylib.11.1 in in /opt/oracle/instantclient_11_2,

export DYLD_FALLBACK_LIBRARY_PATH=$HOME/lib:/usr/local/lib:/lib:/usr/lib:/opt/oracle/instantclient_11_2

Fix dependent Oracle library paths

Use 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 oci8lib_???.bundle by the following command:

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 oci8lib_???.bundle.

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)

@cjbj
Copy link

cjbj commented Sep 9, 2015

@milaniliev the following is not true.

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 environment variables are used during node-oracledb at install time only. Runtime still needs DYLD_LIBRARY_PATH.

@ghost
Copy link
Author

ghost commented Sep 9, 2015

You're right, my apologies. I guess Oracle needs to fix this also.
On Wed, Sep 9, 2015 at 4:22 PM Christopher Jones notifications@github.com
wrote:

@milaniliev https://github.com/milaniliev the following is not true.

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 environment variables are used during node-oracledb at install time
only. Runtime still needs DYLD_LIBRARY_PATH.


Reply to this email directly or view it on GitHub
#89 (comment).

@cjbj
Copy link

cjbj commented Sep 9, 2015

@milaniliev fix in what way? (PS I am Oracle)

@ghost
Copy link
Author

ghost commented Sep 9, 2015

@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.

kubo added a commit that referenced this issue Sep 19, 2015
@kubo
Copy link
Owner

kubo commented Sep 19, 2015

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 DYLD_FALLBACK_LIBRARY_PATH ($HOME/lib, /usr/local/lib, /usr/lib, or /lib),

$ 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 DYLD_FALLBACK_LIBRARY_PATH.

$ 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.

@ghost
Copy link
Author

ghost commented Sep 19, 2015

Nice! Do you have this documented in the README? If not, would you like
help documenting it?
On Sat, Sep 19, 2015 at 9:18 AM Kubo Takehiro notifications@github.com
wrote:

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
DYLD_FALLBACK_LIBRARY_PATH ($HOME/lib, /usr/local/lib, /usr/lib, or /lib),

$ 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
DYLD_FALLBACK_LIBRARY_PATH.

$ 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.


Reply to this email directly or view it on GitHub
#89 (comment).

@kubo
Copy link
Owner

kubo commented Sep 21, 2015

@milaniliev
Well, I'll write it by myself. Thanks!

@rutgerg
Copy link

rutgerg commented Oct 1, 2015

2.2.0 saved my day.Txs

@kubo
Copy link
Owner

kubo commented Oct 4, 2015

Ruby-oci8 2.2.0 was released. It supports OCI_DIR on OS X.

@kubo kubo closed this as completed Oct 4, 2015
@DeepeshKr
Copy link

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.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the environment variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path. Note: DYLD_* environment variables are unavailable for security reasons on OS X 10.11 El Capitan.

Please help me to solve the problem

Thanks

Deepesh
=== full Error message is given below ===

current directory: /Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8
/Users/dk/.rvm/rubies/ruby-2.3.0/bin/ruby -r./siteconf20160131-24072-45ezce.rb extconf.rb
checking for load library path...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. >You may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/dk/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in check_ic_dir': RuntimeError (RuntimeError) from /Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:inget' from extconf.rb:22:in `

'
DYLD_LIBRARY_PATH is not set.
checking DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/dk/lib... no
checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no

checking OCI_DIR...

Error Message:
Set the environment variable DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH or OCI_DIR to point to the Instant client directory.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the environment variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path.
Note: DYLD_* environment variables are unavailable for security reasons on OS X 10.11 El Capitan.

Backtrace:
/Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in check_ic_dir' /Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:inget'

extconf.rb:22:in `'

See:

extconf failed, exit code 1

Gem files will remain installed in /Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1 for inspection.
Results logged to /Users/dk/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/ruby-oci8-2.2.1/gem_make.out

@ghost
Copy link
Author

ghost commented Jan 31, 2016

Deepesh,

Try setting the OCI_LIB env variable to the full path to the Oracle Instant
Client.

On Sun, Jan 31, 2016 at 1:14 PM DeepeshKr notifications@github.com wrote:

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.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the environment variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path. Note: DYLD_* environment variables are unavailable for security reasons on OS X 10.11 El Capitan.

Please help me to solve the problem

Thanks

Deepesh
=== full Error message is given below ===

current directory:
/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8
/Users/dk/.rvm/rubies/ruby-2.3.0/bin/ruby
-r./siteconf20160131-24072-45ezce.rb extconf.rb
checking for load library path...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. >You
may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/dk/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in
check_ic_dir': RuntimeError (RuntimeError)
from
/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:inget'
from extconf.rb:22:in `
'
DYLD_LIBRARY_PATH is not set.
checking DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/dk/lib... no
checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no

checking OCI_DIR...

Error Message:
Set the environment variable DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH
or OCI_DIR to point to the Instant client directory.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the environment
variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the
checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or
DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path.
Note: DYLD_* environment variables are unavailable for security reasons on
OS X 10.11 El Capitan.

Backtrace:
/Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in
check_ic_dir'

/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:in
get'
extconf.rb:22:in `'

See:

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-full-client.md
for Oracle full client

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md
for Oracle instant client

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-on-osx.md
for OS X

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/report-installation-issue.md
to report an issue.

extconf failed, exit code 1

Gem files will remain installed in
/Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1 for inspection.
Results logged to
/Users/dk/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/ruby-oci8-2.2.1/gem_make.out


Reply to this email directly or view it on GitHub
#89 (comment).

@DeepeshKr
Copy link

Hello Milan,

To set the OCI_LIB env variable to the full path to the Oracle Instant
Client I am assuming this is what i needed to do,

export PATH=$PATH:~/opt/oracle/instantclient_11_2 Sadly this doesn't seem
to work.

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,
but any help would be of great use for me. I have spend over 2 days trying
to reach this close to solving this problem. i,e before 2,2,1 fix

Thanks for all your help

Regards

Deepesh

--- i got the following ---
adrci:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

genezi:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1

libclntsh.dylib:
change identification name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

libnnz11.dylib:
change identification name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

libocci.dylib.11.1:
change identification name
from: @rpath/libocci.dylib.11.1
to: /opt/oracle/instantclient_11_2/libocci.dylib.11.1

libociei.dylib:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1

libocijdbc11.dylib:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

libsqlplus.dylib:
change identification name
from: @rpath/libsqlplus.dylib
to: /opt/oracle/instantclient_11_2/libsqlplus.dylib
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

libsqlplusic.dylib:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

sqlplus:
change install name
from: @rpath/libsqlplus.dylib
to: /opt/oracle/instantclient_11_2/libsqlplus.dylib
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

uidrvci:
change install name
from: @rpath/libclntsh.dylib.11.1
to: /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1
change install name
from: @rpath/libnnz11.dylib
to: /opt/oracle/instantclient_11_2/libnnz11.dylib

On Mon, Feb 1, 2016 at 12:34 AM, Milan Iliev notifications@github.com
wrote:

Deepesh,

Try setting the OCI_LIB env variable to the full path to the Oracle Instant
Client.

On Sun, Jan 31, 2016 at 1:14 PM DeepeshKr notifications@github.com
wrote:

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.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the
environment variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the
checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or
DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path. Note: DYLD_* environment
variables are unavailable for security reasons on OS X 10.11 El Capitan.

Please help me to solve the problem

Thanks

Deepesh
=== full Error message is given below ===

current directory:
/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8
/Users/dk/.rvm/rubies/ruby-2.3.0/bin/ruby
-r./siteconf20160131-24072-45ezce.rb extconf.rb
checking for load library path...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. >You
may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/dk/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client

/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in
check_ic_dir': RuntimeError (RuntimeError)
from

/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:inget'
from extconf.rb:22:in `
'
DYLD_LIBRARY_PATH is not set.
checking DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/dk/lib... no
checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no

checking OCI_DIR...

Error Message:
Set the environment variable DYLD_LIBRARY_PATH,
DYLD_FALLBACK_LIBRARY_PATH
or OCI_DIR to point to the Instant client directory.

If DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH is set, the
environment
variable must be set at runtime also.

If OCI_DIR is set, dependent shared library paths are checked. If the
checking is passed, ruby-oci8 works without DYLD_LIBRARY_PATH or
DYLD_FALLBACK_LIBRARY_PATH.

Note: OCI_DIR should be absolute path.
Note: DYLD_* environment variables are unavailable for security reasons
on
OS X 10.11 El Capitan.

Backtrace:

/Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:566:in
check_ic_dir'

/Users/dk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1/ext/oci8/oraconf.rb:316:in
get'
extconf.rb:22:in `'

See:

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-full-client.md

for Oracle full client

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md

for Oracle instant client

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-on-osx.md

for OS X

http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/report-installation-issue.md
to report an issue.

extconf failed, exit code 1

Gem files will remain installed in
/Users/ddk/.rvm/gems/ruby-2.3.0/gems/ruby-oci8-2.2.1 for inspection.
Results logged to

/Users/dk/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/ruby-oci8-2.2.1/gem_make.out


Reply to this email directly or view it on GitHub
#89 (comment).


Reply to this email directly or view it on GitHub
#89 (comment).

@kubo
Copy link
Owner

kubo commented Feb 1, 2016

@DeepeshKr

export OCI_DIR=/opt/oracle/instantclient_11_2

@ghost
Copy link
Author

ghost commented Feb 1, 2016

Deepesh,

What @kubo said. "export PATH" sets the PATH env variable; you want to set
the OCI_DIR variable, so "export OCI_DIR".

Read up on "UNIX environmental variables" on the internet when you have
time, it'll help, I think.

On Mon, Feb 1, 2016 at 6:02 AM, Kubo Takehiro notifications@github.com
wrote:

@DeepeshKr https://github.com/DeepeshKr

export OCI_DIR=/opt/oracle/instantclient_11_2


Reply to this email directly or view it on GitHub
#89 (comment).

@DeepeshKr
Copy link

Hello Milan,

I was able to solve my problem, thanks for all your help and taking time out to reply

Best

Deepesh

On 01-Feb-2016, at 8:36 PM, Milan Iliev notifications@github.com wrote:

Deepesh,

What @kubo said. "export PATH" sets the PATH env variable; you want to set
the OCI_DIR variable, so "export OCI_DIR".

Read up on "UNIX environmental variables" on the internet when you have
time, it'll help, I think.

On Mon, Feb 1, 2016 at 6:02 AM, Kubo Takehiro notifications@github.com
wrote:

@DeepeshKr https://github.com/DeepeshKr

export OCI_DIR=/opt/oracle/instantclient_11_2


Reply to this email directly or view it on GitHub
#89 (comment).


Reply to this email directly or view it on GitHub #89 (comment).

@DeepeshKr
Copy link

Thanks Kubo, this helped me a lot to solve me problem

Best

Deepesh

On 01-Feb-2016, at 4:32 PM, Kubo Takehiro notifications@github.com wrote:

@DeepeshKr https://github.com/DeepeshKr
export OCI_DIR=/opt/oracle/instantclient_11_2

Reply to this email directly or view it on GitHub #89 (comment).

@joelvega
Copy link

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...
checking the default value of DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/joelvega/lib... no
checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no

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?

@ghost
Copy link
Author

ghost commented Feb 29, 2016

@joelvega,

Did you set the OCI_DIR environmental variable to the path to your local
copy of the Oracle Instant Client files?

On Sun, Feb 28, 2016 at 11:49 PM joelvega notifications@github.com wrote:

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...
checking the default value of DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/joelvega/lib... no

checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no

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?


Reply to this email directly or view it on GitHub
#89 (comment).

@joelvega
Copy link

Yes I did, using:
export OCI_DIR=/opt/oracle/instantclient_11_2

And I can see that it worked correctly by using the following command:
env

@kubo
Copy link
Owner

kubo commented Mar 1, 2016

@joelvega
Could you try again?

export OCI_DIR=/opt/oracle/instantclient_11_2
gem install ruby-oci8

If the environment variable OCI_DIR is set as /opt/oracle/instantclient_11_2, the next line of checking OCI_DIR... is checking /opt/oracle/instantclient_11_2....
IMO, you did typo or tried to install ruby-oci8 in other terminal where OCI_DIR was set.

@joelvega
Copy link

joelvega commented Mar 1, 2016

Terminal Saved Output.pdf

@kubo
Attached is my terminal output that shows the step that I took, which is exactly the same as the post you made on September 19, 2015.

IMO, you did typo or tried to install ruby-oci8 in other terminal where OCI_DIR was set.

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.

@kubo
Copy link
Owner

kubo commented Mar 1, 2016

Could you check environment variables under sudo?

sudo env | grep OCI_DIR

If it prints nothing, OCI_DIR is unset in sudo. Use the following command to install ruby-oci8.

sudo env OCI_DIR=/opt/instantclient_11_2 gem install ./ruby-oci8-2.2.1.gem

@joelvega
Copy link

joelvega commented Mar 1, 2016

@kubo, thank you
I tried your suggestion and now I have the following error:

Error Message:
Could not compile with Oracle instant client.
You may need to set the environment variable RC_ARCHS or ARCHFLAGS as follows:

  RC_ARCHS=x86_64
  export RC_ARCHS

or
ARCHFLAGS='-arch x86_64'
export RC_ARCHS

If it does not fix the problem, delete all '-arch i386'
in '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb'.

I have tried RC_ARCHS=x86_64 export RC_ARCHS and ARCHFLAGS='-arch x86_64' export RC_ARCHS and they have not worked. I tried editing rbconfig.rb and I do not have permission to edit it. Would have I have to sudo in order to edit the file?

@kubo
Copy link
Owner

kubo commented Mar 2, 2016

The sudo command may not preserve the caller's environment variables.
Use the following command.

sudo env OCI_DIR=/opt/instantclient_11_2 RC_ARCHS=x86_64 gem install ./ruby-oci8-2.2.1.gem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants