Which will add the environment variables to your .bash_profile, You can also find this in my dotfiles
Test Sql*Plus works
SQL*Plus: Release 188.8.131.52.0 Production on Thu Sep 12 09:19:55 2013
Copyright (c) 1982, 2012, Oracle. All rights reserved.
Oracle Database 11g Enterprise Edition Release 184.108.40.206.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select table_name from user_tables;
You could also store multiple versions of the client, with different .oracle_client files, with a small shell script you could switch between different versions (i.e like when oracle does not fix a bug for 2 years! )
Install Ruby oci gem
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
# Make sure sdk directory is in /usr/local/oracle/product/instantclient_64/220.127.116.11.0/libgem install ruby-oci8
Test that it works…
irbirb(main):001:0>require'oci8'irb(main):006:0>o=OCI8.new('user','pass','127.0.0.1/orademo')=>#<OCI8:user>irb(main):011:0>o.exec('select * from dual')do|r|putsr.join(',');endX=>1irb(main):012:0>exit
If you have issues connecting with an SID or Service Name, try using the IP.
You now have a working oracle database client, and can connect to it from ruby.