hocuspokus

Installing the Ruby Bindings for Oracle on Mac OS X

March 04, 2010

This quick crib sheet is for the guys at work (and anyone else who might need help on this one)…

First install the oracle instant client somewhere - I normally install it to /usr/local/oracle/instantclient_10_2. Then…

cd /usr/local/oracle/instantclient_10_2
ln -s libclntsh.dylib.10.1 libclntsh.dylib

Following this, run mkdir -p /usr/local/oracle/network/admin/, and place a copy of the tnsnames.ora file in this directory.

Now you need to add the following to your .profile or .bashrc file:

# Oracle env variables
export ORACLE_HOME=“/usr/local/oracle/instantclient_10_2”
export DYLD_LIBRARY_PATH=“/usr/local/oracle/instantclient_10_2:$DYLD_LIBRARY_PATH
export SQLPATH=“/usr/local/oracle/instantclient_10_2”
export TNS_ADMIN=“/usr/local/oracle/network/admin”
export NLS_LANG=“AMERICAN_AMERICA.UTF8”
export PATH=$PATH:$DYLD_LIBRARY_PATH

That’s all of the set-up done, now you just need to install the gem:

gem install ruby-oci8

Done. :)

Comments