ruby-oci8 文档http://ruby-oci8.rubyforge.org/en/file.install-instant-client.html 提示在 64 位 mac os 系统使用 32 位 ruby 版本来安装 32 位 ruby-oci8. 但是我在 ruby1.8/1.9 版本都安装失败,有哪位成功安装这个 gem 的分享下,谢谢!
另外,我参考 http://www.liuzihua.org/past/2011/10/26/107_ionrubyoracleoci8/ 也是一样的结果。
我安装失败日志如下:
$ gem install ruby-oci8
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
/Users/wenke/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
checking for load library path...
DYLD_LIBRARY_PATH...
checking /opt/oracle/instantclient_10_2-32bit... skip: /opt/oracle/instantclient_10_2-32bit/libclntsh.dylib.10.1 is for i386 cpu.
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... *** 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/wenke/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby
--with-instant-client
--without-instant-client
./oraconf.rb:758:in `get_version': RuntimeError (RuntimeError)
from ./oraconf.rb:707:in `initialize'
from ./oraconf.rb:319:in `new'
from ./oraconf.rb:319:in `get'
from extconf.rb:18
---------------------------------------------------
Error Message:
cannot get Oracle version from sqlplus
Backtrace:
./oraconf.rb:758:in `get_version'
./oraconf.rb:707:in `initialize'
./oraconf.rb:319:in `new'
./oraconf.rb:319:in `get'
extconf.rb:18
---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/en/HowToInstall.html
* http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html
Gem files will remain installed in /Users/wenke/.rvm/gems/ree-1.8.7-2012.02/gems/ruby-oci8-2.1.2 for inspection.
Results logged to /Users/wenke/.rvm/gems/ree-1.8.7-2012.02/gems/ruby-oci8-2.1.2/ext/oci8/gem_make.out