在OS X El capitan 10.11.3中使用ruby 1.9.3-p551安装ruby-oci8

时间:2016-03-28 11:35:42

标签: ruby-1.9.3 oci8

我正在尝试使用OS X El Capitan 10.11.3中的ruby 1.9.3-p551安装ruby-oci8,但我收到此错误。

Installing ruby-oci8 2.2.1 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.2.1/ext/oci8
/Users/admin/.rbenv/versions/1.9.3-p551/bin/ruby -r ./siteconf20160328-9591-1xmqbsg.rb extconf.rb
checking for load library path... 
  DYLD_LIBRARY_PATH is not set.
  checking DYLD_FALLBACK_LIBRARY_PATH...
    checking /Users/admin/lib... no
    checking /usr/local/lib... no
    checking /lib... no
    checking /usr/lib... no
  checking OCI_DIR...
    checking /opt/oracle/instantclient_11_2... yes
  checking dependent shared libraries in /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1...
  /opt/oracle/instantclient_11_2/libclntsh.dylib.11.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for sys/types.h... yes
checking for ruby header... ok
checking for OCIEnvCreate() in oci.h... yes
checking for OCI_MAJOR_VERSION in oci.h... 11
checking for OCI_MINOR_VERSION in oci.h... 2
checking for localtime_r()... yes
checking for dladdr()... yes
checking for dlmodinfo()... no
checking for dlgetname()... no
checking for ruby/thread.h... no
checking for rb_class_superclass() in ruby.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... no
checking for rb_sym2str() in ruby.h... no
checking for plthook... plthook_osx.c
creating extconf.h
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-15/1.9.1-static/ruby-oci8-2.2.1/mkmf.log

current directory: /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.2.1/ext/oci8
make  clean

current directory: /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.2.1/ext/oci8
make
compiling oci8lib.c
compiling env.c
compiling error.c
error.c:260:15: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    args[1] = INT2FIX(-1);
              ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
1 warning generated.
compiling oci8.c
compiling ocihandle.c
compiling connection_pool.c
compiling stmt.c
compiling bind.c
compiling metadata.c
compiling attr.c
compiling lob.c
compiling oradate.c
oradate.c:488:45: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->century < od2->century) return INT2FIX(-1);
                                            ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:490:39: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->year < od2->year) return INT2FIX(-1);
                                      ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:492:41: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->month < od2->month) return INT2FIX(-1);
                                        ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:494:37: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->day < od2->day) return INT2FIX(-1);
                                    ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:496:39: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->hour < od2->hour) return INT2FIX(-1);
                                      ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:498:43: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->minute < od2->minute) return INT2FIX(-1);
                                          ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
oradate.c:500:43: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (od1->second < od2->second) return INT2FIX(-1);
                                          ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
7 warnings generated.
compiling ocinumber.c
ocinumber.c:1129:16: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        return INT2FIX(-1);
               ^~~~~~~~~~~
/Users/admin/.rbenv/versions/1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:225:48: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~~~~~~~~~^
1 warning generated.
compiling ocidatetime.c
compiling object.c
compiling apiwrap.c
compiling encoding.c
compiling oranumber_util.c
compiling thread_util.c
compiling util.c
compiling plthook_osx.c
compiling hook_funcs.c
linking shared-object oci8lib_191.bundle
ld: file not found: @rpath/libnnz11.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [oci8lib_191.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.2.1 for inspection.
Results logged to /Users/admin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-15/1.9.1-static/ruby-oci8-2.2.1/gem_make.out

但是当我在OS X El Capitan 10.11.3中使用ruby-2.3.0安装ruby-oci8时,它工作正常。

1 个答案:

答案 0 :(得分:0)

我按照http://blog.codiez.co.za/2013/09/setup-oracle-instant-client-ruby-oci8-gem-mac/

解决了这个问题

注意: - 而不是从opt / oracle / instantclient_11_2 /移动文件 将它们复制并粘贴到网站中给出的路径。 :)