To create a new Rails application that uses the Oracle adapter:
$ rails -d oracle my_rails_app
Next, edit config/database.yml with the proper settings.
development: adapter: oracle username: scott password: tiger database: database_name timeout: 5000
For server-side database instances, there appears as of ActiveRecord 2.2.2 and possibly earlier versions, to be a problem using aliases defined in tnsnames.ora. It may be easier to define the database address more explicitly, e.g:
database: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=<host address>)(Port=<port>)))(CONNECT_DATA=(SERVICE_NAME=<service name>)))
To install a local instance of Oracle for development and possibly testing, download and run the Oracle 10g Express Edition installer as appropriate for your operating system environment.
$ gem install activerecord-oracle-adapter --source http://gems.rubyonrails.org
$ sudo gem install activerecord-oracle-adapter --source http://gems.rubyonrails.org
oracle_adapter.rb should be copied to \lib\active_record\connection_adapters within the ActiveRecord gem directory
The activerecord-oracle-adapter does not appear to be under active development at this time. An alternative adapter for Oracle is the oracle-enhanced adapter. To install the enhanced adapter do the following:
$ sudo gem install activerecord-oracle_enhanced-adapter
$ gem install ruby-oci8 -v 1.0.4
Discussion