Installing the Ruby Bindings for Oracle on Mac OS X

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. :)

Spread the Word
  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • Reddit
  • NewsVine
  • Slashdot
  • connotea
  • HackerNews
  • Print
  • email

About Daz

This is the blog of Darren Oakley
This entry was posted in mac, oracle, ruby and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">