31 Aug 2010
I've recently done a proof of concept using RabbitMQ, Spring AMQP and Spring Integration. This...
21 Jul 2010
In over ten years of experience building software, there are patterns and nuances that you...
13 Jul 2010
I set out to find an elegant solution to providing growl notifications for a JRuby...
05 May 2010
I've started playing around with Heroku lately and ran into an issue when I created...
30 Apr 2010
I've been meaning to investigate something that came to mind a while back and just...

Connecting to Oracle from Rails

Published: 01 Aug 2007

Since there are several variations of docs on this (some of which are out of date) I figured I’d document this.

  1. Download and install the Ruby interface from http://rubyforge.org/projects/ruby-oci8/
  2. Then, in your config/database.yml file, you should have something like this:
development:
   adapter: oracle
   database: <your-sid-here>
   host: //<your-host-here>:<your-port-here>
   username: <your-username-here>
   password: <your-password-here>

If you’re running Rails with JRuby you should have the Oracle JDBC drivers in the classpath and the entry above will be a little different:

common: &shared
   adapter: jdbc
   driver: oracle.jdbc.driver.OracleDriver
   url: jdbc:oracle:thin:@<your-host-here>:<your-port-here>:<your-sid-here>
   username: <your-username-here>
   password: <your-password-here>

# oracle (JDBC)
development:
   <<: *shared

blog comments powered by Disqus