Carlos Troncoso
Carlos Troncoso

Reputation: 683

How to install ruby-oci8, the ruby client for oracle on debian based systems (also ubuntu)

Most information found even on the client's homepage is somehow inaccurate or outdated. This is the straight-foward method that worked for me, and I'd like to share with you.

It would be nice if this answer can be expanded by some other system specific methods that might be harder to get it installed on.

Upvotes: 2

Views: 6604

Answers (2)

Ramyani
Ramyani

Reputation: 1039

These are the steps to install ruby-oci8 Gem Installation in Ubuntu.

Step 1: Download the basic & sdk instantclient zip files from https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

instantclient-basic-linux.x64-21.8.0.0.0dbru.zip
instantclient-sdk-linux.x64-21.8.0.0.0dbru.zip

Step 2: Install following packages

sudo apt-get install build-essential
sudo apt-get install libaio-dev

Step 3: Create a folder oracle inside /opt/

mkdir /opt/oracle

Step 4: Go to inside /opt/oracle/

cd /opt/oracle

Step 5: Place the basic instantclient folder inside /opt/oracle

sudo cp ~/Downloads/instantclient-basic-linux.x64-21.8.0.0.0dbru.zip /opt/oracle/

Step 6: Place the sdk instantclient folder inside /opt/oracle

sudo cp ~/Downloads/instantclient-sdk-linux.x64-21.8.0.0.0dbru.zip /opt/oracle/

Step 7: Unzip the basic instantclient folder

sudo unzip instantclient-basic-linux.x64-21.8.0.0.0dbru.zip

Step 8: Unzip the sdk instantclient folder

sudo unzip instantclient-sdk-linux.x64-21.8.0.0.0dbru.zip

Step 9: Check the folders inside /opt/oracle/. It should now have a folder named as instantclient_21_8

Step 10: Update the runtime link path

sudo sh -c "echo /opt/oracle/instantclient_21_8 > \
>       /etc/ld.so.conf.d/oracle-instantclient.conf" 

Step 11: Check the runtime link path, It should now return /opt/oracle/instantclient_21_8

cat /etc/ld.so.conf.d/oracle-instantclient.conf

Step 12: Set the path in env

export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_8:$LD_LIBRARY_PATH

Step 13: Check the path if set properly in env. It should now have proper value set as LD_LIBRARY_PATH=/opt/oracle/instantclient_21_8:/opt/instantclient

env | grep LD_LIBRARY_PATH

Step 14: Now try by installing the gem ruby-oci8

gem install ruby-oci8

It should work now.

Upvotes: 1

Carlos Troncoso
Carlos Troncoso

Reputation: 683

Oracle ruby-oci8 Installing in Ubuntu LTS 12.04 32bit Updated to 64bit version. Thx OneHoopyFrood

  1. First, internal requirements

    sudo apt-get install build-essential
    sudo apt-get install libaio-dev
    
  2. Download oracle instant client from

    http://www.oracle.com/technetwork/topics/linuxsoft-082809.html http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

    You’ll need both zip files, instantclient-basic AND instantclient-sdk

  3. on your machine, make yourself root (sudo su) and make the destination folders:

    mkdir /opt
    mkdir /opt/oracle
    cd /opt/oracle
    
  4. put both files inside /opt/oracle and unzip them.

    unzip instantclient-basic*
    unzip instantclient-sdk*
    
  5. make a symlink of instantclient for easier finding by the system

    cd /opt/oracle/instantclient10_1 
    ln -s libclntsh.so.10.1 libclntsh.so
    
  6. Now, export the LD_LIBRARY_PATH pointing to instantclient path.

    export LD_LIBRARY_PATH=/opt/instantclient
    
  7. NOW… you can install ruby-oci8

    a. if using RVM, use:

    gem install ruby-oci8
    

    b.- if installing to system, use:

    sudo gem install ruby-oci8
    

Hope it helps.

Upvotes: 10

Related Questions