Forum: Ruby on Rails Oracle & Ruby on Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A6be7720d668f4f02160b600e67337e2?d=identicon&s=25 Ivan Medda (axle988)
on 2006-02-20 11:54
I've a remote database create using Oracle. This database use schemas.
I tried to connect to it using Ruby On Rails,with this file Database.yml
:

development:
  adapter: oci
  host: liber
  database: ENERGIA
  username: user
  password: pass


test:
  adapter: oci
  host: liber
  database: ENERGIA
  username: user
  password: pass


production:
  adapter: oci
  host: liber
  database: ENERGIA
  username: user
  password: pass

Where "ENERGIA" is a schema's name.
I want to create a model for a table named "Platts" that is into
ENERGIA.
I use this command: ruby script/generate scaffold platt action_name
But everytime Rails Tell me that this Table doesn't exist!
Can someone tell me what's the problem?
Fb4482bd900141ed8bd3f3fcc3723f90?d=identicon&s=25 Luca Mearelli (Guest)
on 2006-02-20 13:55
(Received via mailing list)
Ivan Medda wrote:
> Where "ENERGIA" is a schema's name.
> I want to create a model for a table named "Platts" that is into
> ENERGIA.

The oracle adapter doesn't use the database parameter.
You can connect passing a tnsnames.ora defined name in the host
parameter. e.g. If you have oracle client installed and this:

ORCL.WORLD =
   (DESCRIPTION =
     (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
     )
     (CONNECT_DATA =
       (SERVICE_NAME = ORCL)
     )
   )

inside you tnsnames.ora then you can connect using

development:
   adapter: oci
   host: ORCL.WORLD
   username: scott
   password: tiger

If you don't have a tnsnames.ora you can still connect passing the
hostname plus the sid to the host parameter e.g.:

development:
   adapter: oci
   host: hostname/ORCL
   username: scott
   password: tiger


Then the schema would be the default one for the scott user (probably
'SCOTT'). in your case you probably need to connect with the ENERGIA
user.

HTH, bye
Luca Mearelli
--
Blog: http://spazidigitali.com
Email mailto://l.mearelli@spazidigitali.com
Skype callto://l.mearelli
--
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-02-20 19:58
(Received via mailing list)
On 2/20/06, Ivan Medda <avemedda@tin.it> wrote:
> I've a remote database create using Oracle. This database use schemas.
> I tried to connect to it using Ruby On Rails,with this file Database.yml
> :

You'll also want to triple-check that your TNS_ADMIN environment
variable is correct.
This topic is locked and can not be replied to.