Skip to content

ruby on rails (2.0.1, 2.0.2) and oracle on FC8

Get the following rpm’s from oracle

  • oracle-instantclient-basic-
  • oracle-instantclient-devel-

(Note: this should work fine with the newer versions as well)

As root

rpm -ivh oracle-instantclient-basic- oracle-instantclient-devel-
echo /usr/lib/oracle/ > /etc/

This last step, the echo, is a bit of magic. The conf files in /etc/ are run before each command is invoked to set your library path. The enviroment variable $LD_LIBRARY_PATH overrides these. You won’t see the contents of these files in your $LD_LIBRARY_PATH, but the application will. If your distribution doesn’t have an /etc/ directory, you can just add /usr/lib/oracle/ to your LD_LIBRARY_PATH inthe /etc/profile, ~/.bash_profile, or any of the other more common places.

Now you need to find the latest ruby-oci8, check and put it in /usr/local/src/

tar -xzvf ruby-oci8-1.0.1.tar.gz
cd ruby-oci8-1.0.1
ruby setup.rb config
make install

The previous versions of oci8 and ora instant clients required that you make several symlinks, and was a pain to set up. With the current oci8 and the instant clients on your LD_LIBRARY_PATH, the compile and install should work just fine.

With rails 2.1 out, the activerecord-oracle-adapter is no longer hosted on You can see this with a “gem list -r –source”. So you have to do the ugly method of directly grabbing the adapter yourself. It is very easy though:

wget -P /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/

That’s it. Just remember to make sure that you grab the right versions of everything.