I\'m trying to install ruby-oci8 on OS X.
I\'ve tried installing both with and without sudo
.
Error Message without sudo
:
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
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.
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'
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
Then follow these steps :-
DYLD_LIBRARY_PATH=/opt/oracle/instantclient_12_1 export DYLD_LIBRARY_PATH ORACLE_HOME=/opt/oracle/instantclient_12_1 export ORACLE_HOME
ln -s libclntsh.dylib.12.1 libclntsh.dylib (creates a symbolic link)
ln -s libocci.dylib.12.1 libocci.dylib
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
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.