Forum: Ruby on Rails Rails + Oracle problems

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.
C0f75c054e0191ad24dd655b2e1b4532?d=identicon&s=25 Reacher (Guest)
on 2007-04-20 16:43
(Received via mailing list)
I'm having a problem getting Rails to connect to my Oracle database.
I have Ruby/Rails installed on a SunOS (sun0) and my Oracle database
(mydb) is installed on another SunOS (sun1).  sun1 has the Oracle
instant client on it, and I can run a simple ruby script to execute
queries just fine:

#!/usr/local/bin/ruby
require 'oci8'

conn = OCI8.new('user', 'pass', '//sun0:3333/mydb')
conn.exec('select count(*) from t_mytest') do |row|
  puts row
end

This runs with no problem.  Now comes my Rails issues.  I've setup a
simple Rails project and in my database.yml file, I swear I've tried
every configuration I can, but the 'rake migrate' command still won't
work.  Here's what my database.yml file looks like:

development:
   adapter: oci
   username: user
   password: pass
   database: //sun0:3333/mydb

development:
   adapter: oci
   username: user
   password: pass
   database: //sun0:3333/mydb

development:
   adapter: oci
   username: user
   password: pass
   database: //sun0:3333/mydb


I've seen some folks saying the 'database' line in database.yml isn't
read, and I've tried it also with the host line in there.  But alas,
it still doesn't work.  Any ideas?

reacher
C0f75c054e0191ad24dd655b2e1b4532?d=identicon&s=25 Reacher (Guest)
on 2007-04-20 16:53
(Received via mailing list)
I guess I should mention the error I am getting.  When run with the
above configuration, rake migrate produces:

rake aborted!
ORA-12162: TNS:net service name is incorrectly specified

If i remove the database: line in database.yml and include this line:

host: sun0

then rake migrate produces:

rake aborted!
ORA-12452: TNS:no listener
This topic is locked and can not be replied to.