Closed antislice closed 3 years ago
The easiest may be (1) installing instantclient from brew and (2) installing instantclient to $HOME/lib.
$ brew uninstall instantclient-basiclite
$ brew uninstall instantclient-sdk
$ mkdir $HOME/lib
$ unzip instantclient-basiclite-macos.x64-12.1.0.2.0.zip
$ cp instantclient_12_1/* $HOME/lib
IMO, you have no need to recompile ruby-oci8.
I have not upgrade my macbookair to macOS Sierra yet. There may be Sierra-specific issue or brew may fix install names and rpaths in the Oracle client libraries but the fix may cause bad effect.
Ok, I tried that and also a few other things.
The initial set of instructions led to this:
%> bundle exec rake spec
rake aborted!
LoadError: dlopen(/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/lib/oci8lib_230.bundle, 9): Library not loaded: /usr/local/opt/instantclient-basiclite/lib/libclntsh.dylib.12.1
Referenced from: /Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/lib/oci8lib_230.bundle
Reason: image not found - /Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/lib/oci8lib_230.bundle
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/lib/oci8.rb:72:in `<top (required)>'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/lib/ruby-oci8.rb:4:in `<top (required)>'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:91:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `each'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `block in require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `each'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `require'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:107:in `require'
/Users/homeslice/work/crisisresponse/config/application.rb:14:in `<top (required)>'
/Users/homeslice/work/crisisresponse/Rakefile:4:in `require'
/Users/homeslice/work/crisisresponse/Rakefile:4:in `<top (required)>'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/Users/homeslice/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'
/Users/homeslice/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
I followed that with changing my OCI_DIR
and the full instructions on installing without homebrew, which led to the same stack trace as above. Also tried linking the directory of the library it can't seem to find (ln -s ~/lib/instantclient_12_1 /usr/local/opt/instantclient-basiclite
), didn't make a difference.
At that point I tried reinstalling the gem, bundle exec gem pristine ruby-oci8
, which failed because it couldn't find ruby-oci8-2.2.3
with a GemNotFound error. The next step was bundle install
, which also failed and the log/gem_make.out is below:
%> cat /Users/homeslice/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/ruby-oci8-2.2.3/gem_make.out
current directory: /Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/ext/oci8
/Users/homeslice/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20170209-44368-1abw1a9.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/homeslice/.rvm/rubies/ruby-2.3.3/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:575:in `check_ic_dir': RuntimeError (RuntimeError)
from /Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:316:in `get'
from extconf.rb:22:in `<main>'
DYLD_LIBRARY_PATH is not set.
DYLD_FALLBACK_LIBRARY_PATH is not set.
checking OCI_DIR...
checking /Users/homeslice/lib... no
checking the default value of DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/homeslice/lib... no
checking /usr/local/lib... no
checking /lib... no
checking /usr/lib... no
---------------------------------------------------
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/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:575:in `check_ic_dir'
/Users/homeslice/.rvm/gems/ruby-2.3.3/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:316:in `get'
extconf.rb:22:in `<main>'
---------------------------------------------------
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
My original issue is not particularly urgent at the moment, since those rake tasks aren't mission critical at this time. The install with Homebrew worked for me otherwise, so I'll be going back to that for the time being. Thanks!
I have the similar issue. What's a strange on this thing it has started today. I'm not sure what changes I made before.
After invoking rails s
I'm getting this issue
$ rails s
~/.gem/ruby/2.3.1/gems/bundler-1.14.5/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'ruby-oci8'. (Bundler::GemRequireError)
Gem Load Error is: OCI Library Initialization Error - /usr/local/opt/instantclient-basiclite/lib/libclntsh.dylib.12.1
Backtrace for gem load error is:
oci8lib.c:156:in oci8lib_230.bundle
~/.gem/ruby/2.3.1/gems/ruby-oci8-2.2.3/lib/oci8.rb:72:in `<top (required)>'
~/.gem/ruby/2.3.1/gems/ruby-oci8-2.2.3/lib/ruby-oci8.rb:4:in `require'
Closed due to inactivity, feel free to open another ticket if the problem persists.
I've had trouble with a couple rake commands when bundler is trying to load this gem. Installing the gem worked fine, and most actions I take are fine.
Issues with:
rake annotate_routes
(using annotate gem, that rake task callsrake routes
internally, so the issue may also be there)annotate --routes
, from the same gem as above also shows this error due to therake routes
callrake spec
console log (they're similar for the different tasks):
system info: macOS Sierra 10.12.3
gcc
gcc --print-prog-name=ld
: /Library/Developer/CommandLineTools/usr/bin/ldgcc --print-prog-name=as
: /Library/Developer/CommandLineTools/usr/bin/asOracle
Don't have Oracle full client
Oracle instant client:
I was under the impression that El Capitan and later wouldn't have
$DYLD_LIBRARY_PATH
set however.