How to install ruby-oci8?

后端 未结 11 1442
一生所求
一生所求 2020-12-24 08:24

I\'m trying to install ruby-oci8 on OS X.

I\'ve tried installing both with and without sudo.

Error Message without sudo:

         


        
相关标签:
11条回答
  • 2020-12-24 09:02

    On OS X Sierra, I was unable to set DYLD_LIBRARY_PATH due to system integrity protection (https://forums.developer.apple.com/thread/13161), so I copied all oracle's instant client files to /users/.../lib, since it has a fallback to some directories including this one:

    ...
    checking the default value of DYLD_FALLBACK_LIBRARY_PATH...
    checking /Users/<username>/lib... no
    checking /usr/local/lib... no
    checking /lib... no
    checking /usr/lib... no
    ...
    

    And the gem installed successfully!

    cp -R /opt/oracle/instantclient_11_2/* /users/..username../lib
    gem install ruby-oci8
    
    Building native extensions.  This could take a while...
    Successfully installed ruby-oci8-2.2.2
    1 gem installed
    
    0 讨论(0)
  • 2020-12-24 09:04

    For some reason ruby-oci8 was not getting installed with instant client_11_2 for me. I tried all the answers suggested here and other places but couldnt get it done. Later I tried with instant client 12_1 and it worked without any issues.

    0 讨论(0)
  • 2020-12-24 09:05

    updated version of install of ruby-oci8 for CENTOS7

    cd /etc/yum.repos.d
    sudo wget http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7
    sudo rpm --import RPM-GPG-KEY-oracle-ol7
    sudo yum-config-manager --enable ol7_oracle_instantclient
    sudo yum install oracle-instantclient18.3-basic
    sudo yum install oracle-instantclient18.3-devel
    sudo yum install oracle-instantclient18.3-jdbc
    sudo yum install oracle-instantclient18.3-sqlplus
    export ORACLE_HOME=/usr/lib/oracle/18.3/client64
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    gem install ruby-oci8 -v '2.2.7'
    
    0 讨论(0)
  • 2020-12-24 09:06

    If you are using OS X El Capitan, Yosemite and Mavericks. You should use Instant Client 12.1.0.2 Download Instant Client 12.1.0.2 from oracle website

    1. instantclient-basic-macos.x64-12.1.0.2.0.zip
    2. instantclient-sqlplus-macos.x64-12.1.0.2.0.zip
    3. instantclient-sdk-macos.x64-12.1.0.2.0.zip

    Then follow these steps :-

    1. Create directories at /opt/oracle
    2. Unzip instantclient-basic first, move to /opt/oracle (should add a folder -
      something like /opt/oracle/instantclient_12_1/)
    3. Unzip instantclient-sdk and move its contents to /opt/oracle/instantclient_12_1/
    4. Unzip instantclient-sqlplus and move its contents /opt/oracle/instantclient_12_1/
    5. Open Terminal (if you haven't already) and type...

    DYLD_LIBRARY_PATH=/opt/oracle/instantclient_12_1 export DYLD_LIBRARY_PATH ORACLE_HOME=/opt/oracle/instantclient_12_1 export ORACLE_HOME

    1. cd /opt/oracle/instantclient_12_1

    ln -s libclntsh.dylib.12.1 libclntsh.dylib (creates a symbolic link)

    ln -s libocci.dylib.12.1 libocci.dylib

    1. run: env
      1. verify that DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 (be sure there's
        no trailing / after instantclient_11_2) verify ORACLE_HOME=/opt/oracle/instantclient_11_2
      2. gem install ruby-oci8 -v gemVersion

    Note:- If this still didn't work fro you try disabling SIP on your mac then try it again.

    It has worked for me hope it works for you too. All the best

    0 讨论(0)
  • 2020-12-24 09:11

    For anyone attempting to get this to work in the good old year of 2016, the error message now contains a link to the page http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-on-osx.md that gives you instructions for how to do it using Homebrew. None of the above stuff worked for me (and I tried it all), but then I took this problem to a coworker and they said, "Hey, did you try that link in the error message there?" Sure enough, that did it.

    0 讨论(0)
提交回复
热议问题