Tuesday, 29 April 2008

Using the ruby oracle_adapter on Windows XP

I have been having some problems getting my windows install of ruby to connect to oracle. It is so much easier on ubuntu. Looking at the blog of a friend Andrew Beacock other people have had the same problem, admittedly a while ago.

I tried the gem install command:
gem install activerecord-oracle-adapter
with no luck.

I tried
gem install activerecord-oracle-adapter --source http://gems.rubyforge.org
also with no luck.

Then I tried this. I am sure it is not the purist solution but it works !!!
Download the oracle_adapter.rb

Then copy this into the relevant directory under where you have ruby installed.
C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.0.2\lib\active_record\connection_adapters

And bobs your father's brother ...

My database.yml file looks like this:
development:
adapter: oracle
database: my_sid
username: my_user
password: my_password

2 comments:

MDWeezer said...

It may have been a typo on your part...

gem install activerecord-oracle-adapter --source http://gems.rubyonrails.org

That works just fine (adapter, not adaptor).

Bill Comer said...

cheers mdweezer.

It was a typo.
Not sure why I can not get gem install to work. Very annoying.