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

DYLD_LIBRARY_PATH not working #85

Closed
songjiz opened this issue Jul 14, 2015 · 4 comments
Closed

DYLD_LIBRARY_PATH not working #85

songjiz opened this issue Jul 14, 2015 · 4 comments

Comments

@songjiz
Copy link

songjiz commented Jul 14, 2015

Excuse me, there are some trouble when i install this gem in my macbook with OX EL Capitian. I has set the environment variables as follow:
1
But it's seem that the DYLD_LIBRARY_PATH variable is not working.
The error message as follow:
Building native extensions. This could take a while...
/Users/leky/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20150714-22052-1jb0893.rb extconf.rb
checking for load library path...
DYLD_LIBRARY_PATH is not set.
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
Get the version of Oracle from SQL*Plus... ---------------------------------------------------
Error Message:
cannot get Oracle version from sqlplus
Backtrace:
/Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:762:in get_version' /Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:711:ininitialize'
/Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:320:in new' /Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:320:inget'

extconf.rb:18:in `'

See:

*** 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
--without-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/leky/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:762:in get_version': RuntimeError (RuntimeError) from /Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:711:ininitialize'
from /Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:320:in new' from /Users/leky/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:320:inget'
from extconf.rb:18:in `

'
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.

Building has failed. See above output for more information on the failure.

extconf failed, exit code 1

And the environment variables in pry:
[1] pry(main)> ENV['ORACLE_BASE']
=> "/usr/local/oracle"
[2] pry(main)> ENV['ORACLE_HOME']
=> "/usr/local/oracle/product/instantclient_11_2"
[3] pry(main)> ENV['DYLD_LIBRARY_PATH']
=> nil

as you can see, the DYLD_LIBRARY_PATH variable is not working.
I was confused by this problem for several days。
Thanks for your help

@kubo
Copy link
Owner

kubo commented Jul 14, 2015

Firstly, could you check the environment variable in shell?

$ env | grep DYLD_LIBRARY_PATH

If it is set, did you run ruby via a setuid or setgid program?
DYLD_* environment variables are unset for security reasons if a program is setuid or setgid.

@songjiz
Copy link
Author

songjiz commented Jul 15, 2015

Thanks !
I check the environment variables and DYLD_LIBRARY_PATH is not set.
It was working fine in Yosemite, but after upgrading to EL CAPITIAN, it cant not work any more!!!

@kubo
Copy link
Owner

kubo commented Jul 15, 2015

I closed this issue because this isn't a ruby-oci8 issue.

This is an OS issue. DYLD_ environment variables are unset in some cases
in the latest beta version.
https://forums.developer.apple.com/thread/9233

@kubo kubo closed this as completed Jul 15, 2015
@kubo
Copy link
Owner

kubo commented Oct 4, 2015

DYLD_ environment variables are unset by design on OS X 10.11 El Capitan.
Use ruby-oci8 2.2.0 and look at http://www.rubydoc.info/github/kubo/ruby-oci8/master/file/docs/install-on-osx.md.

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

2 participants