Forum: Ruby on Rails Rails Oracle connection

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.
9c12e8da27adb8f1baae695992872ff4?d=identicon&s=25 Tom Hofte (tomhofte)
on 2006-03-28 18:14
I'm using the following configuration in the database.yml to connect to
Oracle,
however I could not connect while the settings seems to be correct:

development_oracle:
  adapter: oci
  host: 127.0.0.1:8080/XE
  username: rubydb
  password: rubyrails

What is wrong here?

Can anyonbe help me?
5214532353dd528a50ead7d3beb866cb?d=identicon&s=25 William Groppe (Guest)
on 2006-03-28 18:41
(Received via mailing list)
Hey Tom,

Try setting up a TNSNAMES.ORA file.

It should look something like this:

XE =
   (DESCRIPTION =
     (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 8080))
     )
     (CONNECT_DATA =
       (SID = XE)
       (SERVER = DEDICATED)
     )
   )

Then in your database.yml you put:

development:
   adapter: oci
   host: xe
   username: rubydb
   password: rubyrails

You'll have to look up where in your installation the TNSNAMES.ORA
file should live, but this solution works like a charm for me.

-wilig
9c12e8da27adb8f1baae695992872ff4?d=identicon&s=25 Tom Hofte (tomhofte)
on 2006-03-28 19:12
William Groppe wrote:
> Hey Tom,
>
> Try setting up a TNSNAMES.ORA file.
>
> It should look something like this:
>
> XE =
>    (DESCRIPTION =
>      (ADDRESS_LIST =
>        (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 8080))
>      )
>      (CONNECT_DATA =
>        (SID = XE)
>        (SERVER = DEDICATED)
>      )
>    )
>
> Then in your database.yml you put:
>
> development:
>    adapter: oci
>    host: xe
>    username: rubydb
>    password: rubyrails
>
> You'll have to look up where in your installation the TNSNAMES.ORA
> file should live, but this solution works like a charm for me.
>
> -wilig

Hi Willig,

Thank you for your help!
I works now just fine
This topic is locked and can not be replied to.