Rails + Oracle

I have tried every connection string on the Rails site and it will not
connect. I can create a regular dbi script and connect and pull out
data.

If someone is using Rails + Oracle can you post the relevent portions
of your connection string? Please?!

Robert

Robert H. wrote:

I have tried every connection string on the Rails site and it will not
connect. I can create a regular dbi script and connect and pull out
data.

If someone is using Rails + Oracle can you post the relevent portions
of your connection string? Please?!

Not sure what you’re looking for. If you can connect to the database
using sqlplus:

$ sqlplus user/[email protected]

then the following database.yml entry should work for you:

development:
adapter: oci
host: dbhost
username: user
password: pass

I will try those but I believe I already have to no avail. I will try
and see.

Robert

On 2/3/06, Robert H. [email protected] wrote:

I will try those but I believe I already have to no avail. I will try
and see.

If all else fails, strip the newlines from a full TNSNAMES.ORA entry,
and put it on the host line.
I’ve had to do that on crazy instantclient servers in the past.

“Robert H.” [email protected] writes:

I have tried every connection string on the Rails site and it will not
connect. I can create a regular dbi script and connect and pull out
data.

If someone is using Rails + Oracle can you post the relevent portions
of your connection string? Please?!

Robert

Problem is, there are SO many ways to configure Oracle. The following
simple thing works for me:

development:
adapter: oci
database: SID
host: SID
username: scott
password: tiger

(I believe ‘database’ isn’t actually used.) Then I have this in
tnsnames.ora:

SID =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host.domain.edu)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = sid)
)
)

On my Powerbook, HOST = localhost because I tunnel the database
connection over SSH.

Steve

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs