Step 1: Download Oracle
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Step 2:
mkdir /opt/oracle
cd /opt/oracle
git clone https://github.com/kubo/ruby-oci8 ruby-oci8
unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
unzip instantclient-sqlplus-linux.x64-12.1.0.2.0.zip
ln -s libclntsh.so.12.1 libclntsh.so
#!/bin/bash
echo "export PATH=$PATH:/opt/oracle/instantclient_12_1" >> /root/.bashrc
echo "export SQLPATH=/opt/oracle/instantclient_12_1" >> /root/.bashrc
echo "export TNS_ADMIN=/opt/oracle/instantclient_12_1" >> /root/.bashrc
echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1" >> /root/.bashrc
echo "export ORACLE_HOME=/opt/oracle/instantclient_12_1" >> /root/.bashrc
export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1
cd ruby-oci8
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install