[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and Oracle on Win XP

Laurent

11/28/2006 6:51:00 PM

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

5 Answers

Wilson Bilkovich

11/28/2006 8:04:00 PM

0

On 11/28/06, Laurent <laurent.bois@gmail.com> wrote:
> 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?
>

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/pa...

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

Michael Schoen

11/28/2006 9:51:00 PM

0

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: ...


Jaypee

11/29/2006 7:54:00 PM

0

Laurent a écrit :
> 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
>
Hello Laurent,
There is a short tutorial on Oracle Technology Network:
<http://www.oracle.com/technology/pub/articles/haefel-oracle-rub...
It might help.
Jean-Pierre

Jason Vogel

11/29/2006 10:39:00 PM

0

Somehow, my post got lost.

I also have a post on my blog that might be of help :
http://jasonvogel.blogspot.com/2006/11/invoking-plsql-package-routine...

Jason

On Nov 29, 1:54 pm, Jaypee <rf.ooda...@sd.eepyaj> wrote:
> Laurent a écrit :
>
> > 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?
>
> > LaurentHello Laurent,
> There is a short tutorial on Oracle Technology Network:
> <http://www.oracle.com/technology/pub/articles/haefel-oracle-rub...
> It might help.
> Jean-Pierre

KUBO Takehiro

11/30/2006 1:40:00 PM

0

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'))"

--
Posted via http://www.ruby-....