Download the following packages from Oracle Technology Network.
You have to sign up for an Oracle Technology Network account, which is lame, Oracle, c'mon.
- Instant Client Package - Basic or Basic Lite
- Instant Client Package - SDK
- Instant Client Package - SQL*Plus
Note: use 32-bit packages for 32-bit ruby even though the OS is 64-bit.
Run the following (assuming the zip files were saved to your Downloads folder):
sudo mkdir -p /opt/oracle
cd /opt/oracle
sudo unzip $HOME/Downloads/instantclient-basic-macos.*.zip
sudo unzip $HOME/Downloads/instantclient-sdk-macos.*.zip
sudo unzip $HOME/Downloads/instantclient-sqlplus-macos.*.zip
cd instantclient_11_2/ # yours may be a different version
sudo ln -s libclntsh.dylib.11.1 libclntsh.dylib # yours may be a different version
Add this to your shell environment (.bash_profile or similar):
export DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 # yours may be a different version
Run
ruby -r mkmf -e ""
If it doesn't error, you're fine, if it does, you're screwed, sorry.
Also, I assume you can compile shit. If not, how did you get this far?
Pray to any and all entities you see fit, and perform all applicable magical spells, etc.
Run
gem install ruby-oci8
It probably didn't work, sorry about that.