From: Vetrivel Vetrivel on 30 Nov 2009 09:27 Takehiro Kubo wrote: > Hi, > > On Wed, Apr 15, 2009 at 12:09 AM, Peter Bailey <pbailey(a)bna.com> wrote: >>>> Exception: Could not load driver (unitialized constant OCI8::Driver) > > Did you manually edit dbi.rb? > The OCI8 Driver defines DBI::DBD::OCI8::Driver, but not OCI8::Driver. > >>> What version of ruby, ruby-dbi and ruby-oci8 do you use? >>> How did you install ruby-dbi and ruby-oci8? >> >> Thanks, >> I'm using Ruby 1.8.6. I did a gem install of dbi, so, presumably, it's >> the latest. And, I downloaded and installed the latest version of oci8, >> for Windows. > > ruby-dbi 0.4.1? > ruby-oci8 2.0.1 or 1.0.5? > > Could you tell me the result of the following command on the irb > console? > > require 'dbi' > DBI::VERSION > require 'oci8' > OCI8::VERSION > dbd_dr = DBI::DBD.const_get(:OCI8) > dbd_dr::Driver.new > DBI.connect('dbi:OCI8:', 'username', 'password') > > Copy and paste the output as follows: > > c:\> irb > irb(main):001:0> require 'dbi' > => true > irb(main):002:0> DBI::VERSION > => "0.4.1" > irb(main):003:0> require 'oci8' > => true > irb(main):004:0> OCI8::VERSION > => "2.0.1" > irb(main):005:0> dbd_dr = DBI::DBD.const_get(:OCI8) > => DBI::DBD::OCI8 > irb(main):006:0> dbd_dr::Driver.new > => #<DBI::DBD::OCI8::Driver:0xf7a1bb3c> > irb(main):007:0> DBI.connect('dbi:OCI8:', 'username', 'password') > => #<DBI::DatabaseHandle:0xf7a13310 @driver_name="OCI8", > @trace_mode=nil, @convert_types=true, > @handle=#<DBI::DBD::OCI8::Database:0xf7a13220 @attr={}, > @handle=#<OCI8:RUBY>>, @trace_output=nil> > irb(main):008:0> I followd your steps . But while connecting . DBI.connect('dbi:OCI8:databasename:ipaddress', 'username', 'password') I got following error DBI::DatabaseError: ORA-12154: TNS:could not resolve the connect identifier specified -- Posted via http://www.ruby-forum.com/.
|
Pages: 1 Prev: Oracle-oci8.2.0 Next: RubyGems nightmare due to 2 installs |