# Ruby and Oracle on Win XP

**URL:** <https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553>\
**Category:** Ruby\
**Created:** [November 28, 2006, 7:56pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553 "2006-11-28T19:56:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 28, 2006, 7:56pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/1 "2006-11-28T19:56:09Z")

</div>

Hello,

I’m currently trying to make run a Rails webapp over Oracle XE (Express  
Edition 10g)

I started to :  
Install Ruby 1.8.5 (One Click Installer) for Windows  
Install Rails 1.1.6  
Install ruby-oci8 (Windows ruby script)

Then i setup the database.yml in my web app as the following:

development:  
adapter: oci  
host: localhost/xe  
username: rails\_dev  
password: secret

While generating a model : script/generate model product  
I get the error:

C:\ruby\lib\ruby\gems\1.8/gems/activerecord-1.14.4/lib/active\_record/conne  
ction\_adapters/abstract/connection\_specification.rb:194:in  
`establish_connection ': development database is not configured (ActiveRecord::AdapterNotSpecified) from C:\ruby\lib\ruby\gems\1.8/gems/activerecord-1.14.4/lib/active _record/connection_adapters/abstract/connection_specification.rb:185:in`establi  
sh\_connection’

Has anyone already seen this kind of error…  
I have several Oracle Homes on my system, but i’ve set before the  
ORACLE\_HOME pointing to the Oracle XE database home.

Any idea?

Laurent

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 28, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/2 "2006-11-28T21:04:31Z")

</div>

On 11/28/06, Laurent [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Then i setup the database.yml in my web app as the following:  
> C:\ruby\lib\ruby\gems\1.8/gems/activerecord-1.14.4/lib/active\_record/conne  
> I have several Oracle Homes on my system, but i’ve set before the  
> ORACLE\_HOME pointing to the Oracle XE database home.
> 
> Any idea?

adapter: oci still works, but it is supposedly deprecated. They want  
us to use “adapter: oracle” these days. I doubt that’s your problem,  
though.

I recommend setting up your connection information in TNSNAMES.ORA,  
and then using the SID name you defined there on the ‘host’ line.  
So, if your sid is BLAH\_DEV, you would have host: BLAH\_DEV

Parts of this look a little out of date, but it may still help:  
[http://wiki.rubyonrails.org/rails/pages/Oracle](http://wiki.rubyonrails.org/rails/pages/Oracle)

Stay the course, though, because Oracle and Ruby work fine together on  
XP.

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 28, 2006, 10:52pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/3 "2006-11-28T22:52:55Z")

</div>

Laurent wrote:

> Then i setup the database.yml in my web app as the following:
> 
> development:  
> adapter: oci  
> host: localhost/xe  
> username: rails\_dev  
> password: secret

Did the spacing get munged above, or is that really what it looks like?  
The attributes of the development configuration should be indented, as  
in:

development:  
adapter: oracle  
host: …  
username: …  
password: …

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 29, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/4 "2006-11-29T20:56:50Z")

</div>

Laurent a écrit :

> Then i setup the database.yml in my web app as the following:  
> C:\ruby\lib\ruby\gems\1.8/gems/activerecord-1.14.4/lib/active\_record/conne  
> I have several Oracle Homes on my system, but i’ve set before the  
> ORACLE\_HOME pointing to the Oracle XE database home.
> 
> Any idea?
> 
> Laurent

Hello Laurent,  
There is a short tutorial on Oracle Technology Network:  
[http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html](http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html)  
It might help.  
Jean-Pierre

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 29, 2006, 11:41pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/5 "2006-11-29T23:41:35Z")

</div>

Somehow, my post got lost.

I also have a post on my blog that might be of help :

> **[Ruby: Invoking a PL/SQL Package with Array args](https://jasonvogel.blogspot.com/2006/11/invoking-plsql-package-routine-with.html)**
>
> I'm fairly new to Ruby (and subsequently to Rails). I would be normally be labeled an "Enterprise Developer"... yada, yada. Anyway, I'm t...

Jason

---

<div class="post-metadata">

**Author:** ![laurent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ce7236/32.png) [@laurent](https://www.ruby-forum.com/u/laurent)\
**Post date:** [November 30, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/ruby-and-oracle-on-win-xp/77553/6 "2006-11-30T14:39:58Z")

</div>

Hi,

Laurent wrote:

> ': development database is not configured  
> (ActiveRecord::AdapterNotSpecified)

The error class is an ActiveRecord::AdapterNotSpecified.  
It looks like a database.yml parsing error.

Does the following ruby code run?

ruby -r pp -r yaml -e “pp  
YAML::load(File.read(‘config/database.yml’))”
