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:
-
Install ruby & rubygems (I use RVM)
-
Install virtualbox & vagrant
-
Install git
-
Clone Hilverd Reker's Oracle Vagrant project:
git clone https://github.com/hilverd/vagrant-ubuntu-oracle-xe.git
-
This project uses Puppet for provisioning, so install that
gem install puppet
-
You also need to install the vbguest Vagrant plugin
vagrant plugin install vagrant-vbguest
-
-
Download Oracle XE 11g and put the file in vagrant-ubuntu-oracle-xe/modules/oracle/files/
-
Install Oracle Instant Client
-
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:
-
Create the test user/schema as described in the testing readme
-
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'
-
Run
rake spec