Ruby on Rails and Oracle

Hello, I’m having a trouble when I try to connect RoR and Oracle.
I believe that it has something to do with database.yml, this is how my
database.yml looks:
development:
adapter: oci
database: 127.0.0.1:1521/XE
username: system
password: y1984nip0359
host: 127.0.0.1

And this is the Error that i get:

-> http://127.0.0.1:3000/blog

OCIError in BlogController#index

ORA-12514: TNS:listener does not currently know of service requested in
connect descriptor

RAILS_ROOT: C:/ruby/bin/blog/script/…/config/…
Application Trace | Framework Trace | Full Trace

env.c:257:in oci8lib.so

Any help?

Hi Eder,

I just wrote a not-so-small Rails app with Oracle and had quite some
trouble setting it up, but since then it works flawlessly.

database.yml looks:
development:
adapter: oci
database: 127.0.0.1:1521/XE
username: system
password: y1984nip0359
host: 127.0.0.1

This is mine:

development:
adapter: oracle
database: //localhost:1521/XE
username: seek-rat
password: seek-rat

You could maybe try to change the adapter to oracle.
What’s your version of Rails?
And the version of your Oracle driver (I had to fiddle around with that
quite a bit, though it was under linux)

ORA-12514: TNS:listener does not currently know of service requested in
connect descriptor

Are you sure you can connect with the same credentials from Oracle
sql-developer (or any other tool creating a connection to the DB)? If
yes, probably your ruby-oracle driver has some problems…

Cheers,
Peter


http://www.rubyrailways.com
http://scrubyt.org

On 10/23/07, Eder Quiñones [email protected] wrote:

Hello, I’m having a trouble when I try to connect RoR and Oracle.
I believe that it has something to do with database.yml, this is how my
database.yml looks:
development:
adapter: oci
database: 127.0.0.1:1521/XE
username: system
password: y1984nip0359
host: 127.0.0.1

This is mine:

development:
adapter: oracle
database: 127.0.0.1/XE
username: myapp_dev
password: changeme


Greg D.
http://destiney.com/

All of these look odd to me. How is your Oracle networking set up? Do
you
have a tnsnames.ora file? For ‘database’, I use the connection name from
my
tnsnames.ora file.

foo_dev:
adapter: oracle
database: PROD
username: foo
password: foopass


Cynthia K.

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