Article:
  Rolling with Ruby on Rails
Subject:   using oracle instead of mysql doesn't work
Date:   2005-06-12 20:06:14
From:   amchi
I'm using Oracle instead of mysql for this example. I've also installed Ruby/OCI8 on WinXP Pro. When I try to ruby script\generate model Recipe I get these errors:


c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:83:in `establish_connection': database configuration specifies nonexistent OCI8 adapter (ActiveRecord::AdapterNotFound)
from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:75:in `establish_connection'
from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:70:in `establish_connection'
from ./script/../config/environment.rb:47
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
from script/server:42


In database.yml, I've tried the following values for adapter: oracle, Oracle, oci8, OCI8 but no luck. Any thoughts as to how I can make Rails recognize oracle adapter?

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • using oracle instead of mysql doesn't work
    2006-02-01 08:46:58  GrantAaron [View]

    make sure your database.yml file is setup like this:


    development:
    adapter: oci
    host: hostname/database
    username: test
    password: test


    I got oci8 running successfully, even creating a scaffold from a table in oracle. Granted, i'm running this on a mac (you're on windows)... I used this guide, maybe it will give you some clues:

    http://creativi.st/blog/articles/2005/06/25/rails-oracle-client-on-mac-os-x
  • Curt Hibbs photo using oracle instead of mysql doesn't work
    2005-06-12 20:54:53  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    You should post the to the Rails Mailing List (or the Rails IRC Chat). This is where you'll find the existing expertise with Oracle who can surely help you out. You can find information about both here:

    http://wiki.rubyonrails.com/rails/show/HomePage
    • using oracle instead of mysql doesn't work
      2005-06-13 08:21:13  amchi [View]

      Thanks for pointing me to that page. I referred http://wiki.rubyonrails.com/rails/show/HowtoConnectToOracle and it worked like a charm.

      Lesson learnt: If your oracle database is on a remote host, leave the host field blank in database.yml. It'll pick up the value from tnsnames.ora.