From: KUBO Takehiro Date: 2009-04-15T23:53:41+09:00 Subject: Re: connecting to Oracle using OCI8 and DBI On Wed, Apr 15, 2009 at 11:26 PM, Peter Bailey wrote: > Takehiro Kubo wrote: >> On Wed, Apr 15, 2009 at 10:34 PM, Peter Bailey wrote: >>> DBI is version 0.1.1. The latest dbi is 0.4.1. You would use dbi bundled with One Click Ruby Installer. >>> OCI8 is version 1.0.5 >> >> Thanks. >> What about other information I requested in my previous reply? > > F:\workflows\graphics>irb > irb(main):001:0> require 'dbi' > => true > irb(main):002:0> require 'oci8' > => true > irb(main):003:0> dbd_dr = DBI::DBD.const_get(:OCI8) > => OCI8 I have thought that DBI::DBD.const_get(:OCI8) would return DBI::DBD::OCI8 and it would raise an exception if DBI::DBD::OCI8 is not defined. But it returns OCI8 if DBI::DBD::OCI8 is not found. I have misunderstood. > irb(main):004:0> dbd_dr::Driver.new > NameError: uninitialized constant OCI8::Driver >        from (irb):4 > irb(main):005:0> DBI.conect('dbi::OCI8:', 'orcauser', 'orca2user') > NoMethodError: undefined method `conect' for DBI:Module >        from (irb):5 > irb(main):006:0> You did a typo. Use 'connect' instead of 'conect'. DBI.connect will be raise the following exception when using dbi 0.1.1 and oci8 1.0.5. DBI::InterfaceError: Could not load driver (no such file to load -- DBD/OCI8/OCI8) Did you copy oci8.rb to DBD/OCI8/OCI8.rb? You have two ways to use dbi and Oracle. 1. Use the latest dbi instead of 0.1.1. Add "require 'rubygems'" prior to "require 'dbi'". Otherwise, 2. Copy dbd/OCI8.rb to DBD/OCI8/OCI8.rb.