Configuring Ruby on Rails and Oracle on Windows
Apr 06
The title of this post may suggest a few contradictory things. First of all, why would anyone in their right mind try to hook Ruby on Rails to Oracle? Secondly, why would you run Rails on a Windows server? While I don’t have adequate answers for these questions I can tell you that it’s being done and there appears to be decent support for Oracle and Windows. My dev machine at work is an XP laptop so that’s why I’ve ventured down this path. For personal development I prefer OS X and MySQL.
If I haven’t bored you with configuration details I wanted to post about my recent experience with hooking Rails up to Oracle on XP. The first thing I did was create my app by running the rails myapp command. So far, so good. Then I edited my database.yml file to match my Oracle configuration. After setting this up I decided to start the app: ruby script/server. At this point I received all sorts of errors (that I wish I could post here, but I’m writing this from memory). I searched for an answer and realized there were a few things that I was missing. I dug up this link which directed me to the RubyForge project and necessary installer files.
If you’re on Windows then you need to download the ruby-oci8 script and run it. At the time of this post the current version is 0.1.14. You can simply run it by executing the following command: ruby ruby-oci8-0.1.14-mswin32.rb. I believe this copies and shuffles some files around.
I then had to install the oci.dll file, which is included in the Oracle InstantClient download. I downloaded the basic version for Windows from here. After unzipping I added oci.dll to my path and everything was good to go. I started up the app and it ran perfectly. I’ll follow up with a post on my connection settings and my experience creating Rails models.
