[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [ANN] SQLite3/Ruby 1.0.0

Andre Nathan

2/6/2005 11:05:00 PM

Jamis Buck said:
> I'll do some more tinkering and release a 1.0.1 that fixes this.

Cool, thanks.

I noticed this when I started a rails tutorial that uses SQLite3:

irb(main):001:0> require "sqlite3"
=> true

irb(main):002:0> db = SQLite3::Database.open( "foo.db" )
=> #<SQLite3::Database:0x824b854 @closed=false,
@handle=#<DL::PtrData:0x0x8363940 ptr=0x0x8350800 size=0 free=0x0x0>,
@translator=nil, @statement_factory=SQLite3::Statement,
@type_translation=false, @results_as_hash=false,
@driver=#<SQLite3::Driver::DL::Driver:0x81e0a90>>

irb(main):003:0> db2 = SQLite3::Database.open("bar.db")
NameError: uninitialized constant SQLite3::Driver::Native
from
usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:619:in
`const_get'
from
usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:619:in
`load_driver'
from
usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:616:in
`each'
from
usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:616:in
`load_driver'
from
usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:107:in
`initialize'
from (irb):3:in `open'
from (irb):3

In the second Database.open, it tries to use the native driver,
although it used DL on the first one. If I force it to use DL, no
error happens.

Do you know what could be causing that? I'm using ruby 1.8.2 on
DragonFly here.

Andre


1 Answer

Jamis Buck

2/6/2005 11:56:00 PM

0

On 08:04 Mon 07 Feb , Andre Nathan wrote:
> Jamis Buck said:
> > I'll do some more tinkering and release a 1.0.1 that fixes this.
>
> Cool, thanks.
>
> I noticed this when I started a rails tutorial that uses SQLite3:
>
> irb(main):001:0> require "sqlite3"
> => true
>
> irb(main):002:0> db = SQLite3::Database.open( "foo.db" )
> => #<SQLite3::Database:0x824b854 @closed=false,
> @handle=#<DL::PtrData:0x0x8363940 ptr=0x0x8350800 size=0 free=0x0x0>,
> @translator=nil, @statement_factory=SQLite3::Statement,
> @type_translation=false, @results_as_hash=false,
> @driver=#<SQLite3::Driver::DL::Driver:0x81e0a90>>
>
> irb(main):003:0> db2 = SQLite3::Database.open("bar.db")
> NameError: uninitialized constant SQLite3::Driver::Native
> from
> usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:619:in
> `const_get'
> from
> usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:619:in
> `load_driver'
> from
> usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:616:in
> `each'
> from
> usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:616:in
> `load_driver'
> from
> usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:107:in
> `initialize'
> from (irb):3:in `open'
> from (irb):3
>
> In the second Database.open, it tries to use the native driver,
> although it used DL on the first one. If I force it to use DL, no
> error happens.
>
> Do you know what could be causing that? I'm using ruby 1.8.2 on
> DragonFly here.

Yup, I think I know why this happens. I'm currently in the middle of
packing and releasing Net::SSH 1.0, but when I'm done with that I'll
work on fixing this error.

In the meantime, though, the workaround is as you
described--explicitly specify the DL driver.

Thanks for the report,

Jamis

>
> Andre
>
>

--
Jamis Buck
jamis_buck@byu.edu
http://jamis.jam...
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."