Setting up an Oracle VM for testing the Oracle Enhanced Adapter

Oracle + Rails developers whose development machine is a Mac (myself included) have found it difficult to set up a good environment for testing the Oracle Enhanced Adapter, because Oracle no longer provides Mac installers for Oracle 11g. It's possible to set up a virtual environment for running tests, but there isn't much documentation available to help developers set one up. I've documented my Oracle VM setup here:

  1. Install ruby & rubygems (I use RVM)

  2. Install virtualbox & vagrant

  3. Install git

  4. Clone Hilverd Reker's Oracle Vagrant project:

     git clone
    1. This project uses Puppet for provisioning, so install that

       gem install puppet
    2. You also need to install the vbguest Vagrant plugin

       vagrant plugin install vagrant-vbguest
  5. Download Oracle XE 11g and put the file in vagrant-ubuntu-oracle-xe/modules/oracle/files/

  6. Install Oracle Instant Client

  7. Run vagrant up

Now you have an Oracle 11g instance to use for testing. To set up your VM & environment to run oracle_enhanced_adapter tests:

  1. Create the test user/schema as described in the testing readme

  2. Set environment variables so the test suite knows how to connect to the database

     export DATABASE_NAME='XE'
     export DATABASE_HOST='localhost'
     export DATABASE_PORT='1521'
     export DATABASE_SYS_PASSWORD='manager'
  3. Run rake spec