[英]Bundle is failing due to ruby-oci8 gem, for ruby version 2.7.1
嘗試通過捆綁器安裝 oci-8 gem
Installing ruby-oci8 2.2.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8
/Users/piush/.rvm/rubies/ruby-2.7.1/bin/ruby -I /Users/piush/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0 -r ./siteconf20210422-24251-1t9o27q.rb extconf.rb
attempting to locate oracle-instantclient...
checking 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/piush/.rvm/rubies/ruby-2.7.1/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
--with-instant-client-dir
--without-instant-client-dir
--with-instant-client-include
--without-instant-client-include=${instant-client-dir}/include
--with-instant-client-lib
--without-instant-client-lib=${instant-client-dir}/lib
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir': RuntimeError (RuntimeError)
from /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268:in `get'
from extconf.rb:22:in `<main>'
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir': Set the environment variable DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH or
(RuntimeError)
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.
from /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268: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 the default value of DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/piush/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/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir'
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268: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
Gem files will remain installed in /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9 for inspection.
Results logged to /Users/piush/.rvm/gems/ruby-2.7.1/extensions/x86_64-darwin-19/2.7.0/ruby-oci8-2.2.9/gem_make.out
An error occurred while installing ruby-oci8 (2.2.9), and Bundler cannot continue.
Make sure that `gem install ruby-oci8 -v '2.2.9' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
ruby-oci8
即使我在 .bash_profile 文件下聲明了所有必需的變量,我的 Bundle 安裝也會失敗,如下所示:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # 加載默認的.profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH="$HOME/.rbenv/bin:$PATH"
#export DYLD_LIBRARY_PATH="/Users/piush/Documents/oracle_12c/instantclient_12_2"
#export DYLD_FALLBACK_LIBRARY_PATH="/Users/piush/Documents/oracle_12c/instantclient_12_2"
#export ORACLE_HOME="/Users/piush/Documents/oracle_12c//instantclient_12_2"
#export OCI_DIR="/Users/piush/Documents/oracle_12c/instantclient_12_2"
# Add Homebrew's executable directory to the front of the PATH
export PATH=/usr/local/bin:$PATH
~
Eveb 我嘗試單獨安裝 gem,但仍然沒有運氣並得到以下結果:
piush@GUVA-161114-C02Y80Y3JGH8 project % gem install ruby-oci8 -v '2.2.9' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
current directory: /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8
/Users/piush/.rvm/rubies/ruby-2.7.1/bin/ruby -I /Users/piush/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0 -r ./siteconf20210422-25570-10pdwc4.rb extconf.rb
attempting to locate oracle-instantclient...
checking 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/piush/.rvm/rubies/ruby-2.7.1/bin/$(RUBY_BASE_NAME)
--with-instant-client
--without-instant-client
--with-instant-client-dir
--without-instant-client-dir
--with-instant-client-include
--without-instant-client-include=${instant-client-dir}/include
--with-instant-client-lib
--without-instant-client-lib=${instant-client-dir}/lib
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir': RuntimeError (RuntimeError)
from /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268:in `get'
from extconf.rb:22:in `<main>'
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir': Set the environment variable DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH or (RuntimeError)
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.
from /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268: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 the default value of DYLD_FALLBACK_LIBRARY_PATH...
checking /Users/piush/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/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:568:in `guess_ic_dir'
/Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9/ext/oci8/oraconf.rb:268: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
Gem files will remain installed in /Users/piush/.rvm/gems/ruby-2.7.1/gems/ruby-oci8-2.2.9 for inspection.
Results logged to /Users/piush/.rvm/gems/ruby-2.7.1/extensions/x86_64-darwin-19/2.7.0/ruby-oci8-2.2.9/gem_make.out
任何快速幫助都會很棒,因為我被困在這里。 我使用的 ruby 版本是 2.7.1
我遇到了同樣的問題。 發現問題是因為我只安裝了所需的 3 個 Oracle zip 文件中的 2 個。
我已經安裝了:
當我安裝了 instantclient-sdk-macos.x64-11.2.0.3.0.zip 后,終於可以成功運行了:
gem install ruby-oci8 -v '2.2.9'
此處的信息: https://coderwall.com/p/nvva7a/setup-oracle-instant-client-and-ruby-oci8-gem-on-mac
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.