How to install ruby-oci8?
Slightly updated version of install of ruby-oci8 for 10.9/10.10/10.11OSX Mavericks/Yosemite/El Capitan - step-by-step:
- Go here: http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
- Download the 64bit versions of instantclient-sqlplus, instantclient-sdk, instantclient-basic - the 32bit versions do not work with OSX 10.9
- Create directories at /opt/oracle
- Unzip instantclient-basic first, move to /opt/oracle (should add a folder - something like /opt/oracle/instantclient_11_2/)
- Unzip instantclient-sdk and move its contents to /opt/oracle/instantclient_11_2/
- Unzip instantclient-sqlplus and move its contents /opt/oracle/instantclient_11_2/
- Open Terminal (if you haven't already) and type...
DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 export DYLD_LIBRARY_PATH
ORACLE_HOME=/opt/oracle/instantclient_11_2 export ORACLE_HOME
cd /opt/oracle/instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
(creates a symbolic link)env
- verify that DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 (be sure there's no trailing / after instantclient_11_2)
- verify ORACLE_HOME=/opt/oracle/instantclient_11_2
- gem install ruby-oci8
Should work after that. The file structure should look similar to this:
Trouble installing ruby-oci8 gem
You have to set LD_LIBRARY_PATH
to install ruby-oci8
gem. Here I am assuming you are using linux os. Try this on your terminal.
$ LD_LIBRARY_PATH=$ORACLE_HOME/lib
$ export LD_LIBRARY_PATH
$ gem install ruby-oci8
Edit:
If you uses mswin32
ruby, use the following command instead.
gem install --platform x86-mingw32 ruby-oci8
or
gem install --platform x64-mingw32 ruby-oci8
Let me know If you have any query or question.
Happy Coding
trying to install ruby oci8 with bundle install and i tried doing it seperate still not working
In order to compile the native extension gem ruby-oci8, whcih is required for active record oracle adapter, it needs to know the path to the oracle client.
#check the path of your Oracle instanant client install
export LD_LIBRARY_PATH=/opt/oracle/instantclient:$LD_LIBRARY_PATH
$ bundle install
Cannot Install ruby-oci8 on Ubuntu 12.04LTS
I recently had to install oracle + ruby gem, here are the instructions for mac (but would work just as well for ubuntu). Full Instructions are at:
http://blog.codiez.co.za/2013/09/setup-oracle-instant-client-ruby-oci8-gem-mac/
The key is that the ruby-oci gem needs to know where the dynamic libraries are stored. For ubuntu you need to set: LD_LIBRARY_PATH
Grab the following files:
- instantclient-basic-linux.x64-11.2.0.3.0.zip
- instantclient-sqlplus-linux.x64-11.2.0.3.0.zip
- instantclient-sdk-linux.x64-11.2.0.3.0.zip
Extract them and put them somewhere, and then add the following environment variables. See link for detailed instructions.
export ORACLE_BASE=/usr/local/oracle
export ORACLE_HOME=$ORACLE_BASE/product/instantclient_64/11.2.0.3.0
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$DYLD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_BASE/admin/network
Explanation of environment variables:
ORACLE_BASE: Where all the files are stored
ORACLE_HOME: The path to the actual client
LD_LIBRARY_PATH: Should point the the lib directory, make sure you have the SDK zip file extracted here
TNS_ADMIN: where to find your TNS_ADMIN file (not really necessary for ruby-oci gem)
Related Topics
Finding Nil Has_One Associations in Where Query
Rails: Good Rspec2 Example Usage? (Also: Cucumber, Pickle, Capybara)
Ruby Method Calls Declared in Class Body
Failed to Build Gem Native Extension When Install Redcloth-4.2.9 Install Linux
How Would You Test Observers with Rspec in a Ruby on Rails Application
How to Call Expire_Fragment from Rails Observer/Model
Ruby: Most Concise Way to Use an Env Variable If It Exists, Otherwise Use Default Value
Is Require File.Expand_Path(..., _File_) the Best Practice
Why Do I Need to Work Harder to Make My Rails Application Fit into a Restful Architecture
What Should Be Removed from Public Source Control in Ruby on Rails
Finding What Is Common to Two Arrays
How to Get the Number of Days in a Given Month in Ruby, Accounting for Year
Deploying Sinatra App (With Config.Ru) on Heroku Cedar Stack