Oracle & Ruby on Rails

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?

On 2/20/06, Ivan M. [email protected] 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.

Ivan M. 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 M.

Blog: http://spazidigitali.com
Email mailto://[email protected]
Skype callto://l.mearelli