Forum: Ruby Rails + Oracle

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.
49de3af41258a5772a1bad5c1533191d?d=identicon&s=25 Robert Hicks (Guest)
on 2006-02-01 23:25
(Received via mailing list)
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
E75cda3e915fa209386fae3de962cb6a?d=identicon&s=25 Michael Schoen (Guest)
on 2006-02-02 01:30
(Received via mailing list)
Robert Hicks 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/pass@dbhost

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

   development:
     adapter: oci
     host: dbhost
     username: user
     password: pass
Bf1e672f5e54581db4e6d45b7030d286?d=identicon&s=25 Steven Lumos (Guest)
on 2006-02-02 19:38
(Received via mailing list)
"Robert Hicks" <sigzero@gmail.com> 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
49de3af41258a5772a1bad5c1533191d?d=identicon&s=25 Robert Hicks (Guest)
on 2006-02-04 04:25
(Received via mailing list)
I will try those but I believe I already have to no avail. I will try
and see.

Robert
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-02-04 04:34
(Received via mailing list)
On 2/3/06, Robert Hicks <sigzero@gmail.com> 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.
This topic is locked and can not be replied to.