Oracle driver doesn't want to load

M

Ma Ha

Hello,

I hope someone can give a hint what is going wrong here.

I have a Ruby program that connects to an Oracle database using the DBI
module. This is the code for the connecting:

dbh = DBI.connect("DBI:Oracle:db:host", "user", "pw")

I would use the OCI8 driver, but only DBD::Oracle is installed here, and
I won't get OCI8 before Monday ;-)

My program raises following exception while connecting that I don't
understand:

/usr/lib/ruby/vendor_ruby/1.8/dbi.rb:344:in `load_driver': Could not
load driver (no such file to load -- oracle) (DBI::InterfaceError)
from /usr/lib/ruby/vendor_ruby/1.8/dbi.rb:227:in
`_get_full_driver'
from /usr/lib/ruby/vendor_ruby/1.8/dbi.rb:213:in `connect'
from GeoDatabaseController.rb:35:in `connect_to_oracle'
from GeoDatabaseController.rb:339:in `main'
from GeoDatabaseController.rb:350

What is going wrong here? I have looked at dbi.rb for a while trying to
understand, but I still have no clue.

Thanks,
Maria
 
B

Brian Candler

I hope someone can give a hint what is going wrong here.

I have a Ruby program that connects to an Oracle database using the DBI
module. This is the code for the connecting:

dbh = DBI.connect("DBI:Oracle:db:host", "user", "pw")

I would use the OCI8 driver, but only DBD::Oracle is installed here, and
I won't get OCI8 before Monday ;-)

You can't use Oracle from Ruby without ruby-oci8.

Even the DBD::Oracle module is supplied as part of the ruby-oci8 package. (I
don't know if it's *also* included with some other package or available
separately, but it definitely won't work without ruby-oci8 being installed)
/usr/lib/ruby/vendor_ruby/1.8/dbi.rb:344:in `load_driver': Could not
load driver (no such file to load -- oracle) (DBI::InterfaceError)
from /usr/lib/ruby/vendor_ruby/1.8/dbi.rb:227:in
`_get_full_driver'

That implies to me that DBD::Oracle isn't available either.

Anyway, your solution is to go install ruby-oci8 :)

Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top