Skip to content

Instantly share code, notes, and snippets.

@fabianoalmeida
Created April 4, 2011 14:27
Show Gist options
  • Save fabianoalmeida/901725 to your computer and use it in GitHub Desktop.
Save fabianoalmeida/901725 to your computer and use it in GitHub Desktop.
Configuring a Client Oracle on Ubuntu for Ruby Application
# Prerequisites
sudo apt-get install libaio-dev
# Oracle Instant Client
"Instant Client Basic" and "Instant Client SDK" packages from Oracle’s site - http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
# Jump into /opt/oracle and extract them
# You will then end up with a folder such as instant-client_11_2 (the SDK will end up in the same folder).
# Inside this folder, you will want to create a symlink to the current version of the libclntsh.so.* library:
sudo ln -s libclntsh.so.11.1 libclntsh.so
# Adding the newly setup folder into your PATH
export LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2
# Install the gem
env LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 gem install ruby-oci8
# If occurs any problem, try to execute the code above without 'sudo'.
Source: http://nickcharlton.net/post/using-rubyoci8-on-ubuntudebian
# Defining an owner for the new folder
sudo chown user /opt/oracle/
# Giving a permission
sudo chmod 777 /opt/oracle/
##############################################################################################################
# For Ubuntu after version 9.04
sudo gvim /etc/ld.so.conf.d/oracle.conf
# Inside the oracle.conf
/opt/oracle/instantclient_11_2
# To reload the libs
sudo ldconfig -v
##############################################################################################################
# Other option, download the file ruby-oci8-2.0.4.tar.gz from https://rubyforge.org/projects/ruby-oci8/ and execute:
gzip -dc ruby-oci8-2.0.4.tar.gz | tar xvf -
cd ruby-oci8-2.0.4
make
make install
@vinioliveira
Copy link

Might you add this command to reload libconfig without reboot session.

sudo ldconfig -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment