Bugs item #25541, was opened at 2009-04-19 14:29
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=25541&group_id=126

Category: None
>Group: v1.3.x
>Status: Closed
Resolution: Rejected
Priority: 3
Submitted By: John  Spanton (jhs408)
>Assigned to: Eric Hodel (drbrain)
Summary: Ruby sqlite/gem error: Could not load sqlite adapter

Initial Comment:
Executing sample program on windows xp syste,.

The sample  "c:\tmp'Test_sequel.rb"   generates the error: 
  Could not load sqlite adapter. 

Yet, when the example is executed in the sequel directory,  
  no error occur, sample gives the proper results.

The sqlite3.dll is located in the PATH. 

It appears that rubygems is not able to locate sqlite.rb in the 
directory:C:\Ruby\lib\ruby\gems\1.8\gems\sequel-2.12.0\lib\sequel 
\adapters 
when the sample program is executed from c:\tmp 

Which leads me to suspect that rubygem is having a problem 
or the is a coding problem in sequel or rubygems.

Any suggestion or changes to the sample to resolve the error. 
Thanks for the help, 

John email:  jhs...@gmail.com

------------------------------------ 
Windows XP SP3 
Using  ruby 1.8.7,   gem 1.3.2,   sqlite3-ruby 1.2.4,    sequel 2.12.0 
product 
Environment set:  RUBYOPT=rubygems 
PATH=c:\tools\sqlite3   ... 
-----running sample----> c:\tmp\test_sqlite.rb -------------- 
require 'sequel' 
DB = Sequel.sqlite("test-sequel.db") 
# create an items table 
DB.create_table :items do 
  primary_key :id 
  column :name, :text 
  column :price, :float 
end 
# create a dataset from the items table 
items = DB[:items] 
# populate the table 
items << {:name => 'abc', :price => rand * 100} 
items << {:name => 'def', :price => rand * 100} 
items << {:name => 'ghi', :price => rand * 100} 
# print out the number of records 
puts "Item count: #{ items.count }" 
# print out the records in descending order by price 
items.reverse_order(:price).print 
# print out the average price 
puts "The average price is: #{ items.avg :price }" 

------Error Msg---- 
C:\tmp>test_sequel.rb 
C:/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/sequel_core/ 
database.rb:105:in `adapter_class': Could not load sqlite a 
dapter: (Sequel::Error::AdapterNotFound) 
  no such file to load -- sqlite3 
        from C:/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/ 
sequel_core/database.rb:141:in `connect' 
        from C:/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/ 
sequel_core.rb:68:in `connect' 
        from C:/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/ 
sequel_core.rb:157:in `adapter_method' 
        from (eval):1:in `sqlite' 
        from C:/tmp/test_sequel.rb:7 



----------------------------------------------------------------------

>Comment By: Eric Hodel (drbrain)
Date: 2009-05-02 15:52

Message:
Closing, since this works for us and doesn't seem to be a rubygems bug.

----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2009-04-19 14:41

Message:
First, this should have been reported to Sequel and Sqlite3 project, not 
rubygems.

I'll check if sqlite3-ruby gem was compiled properly for your platform, since 
looks like you're using windows and there is no binary for sqlite3-ruby out 
there yet.

I just did the exact same test:

l...@keore (D:\Users\Luis\Desktop)
$ ruby test.rb
Item count: 3
Sequel::Dataset#print is deprecated and will be removed in Sequel 3.0.  require 
"sequel/extensions/pretty_table" first.
D:/Users/Luis/.gem/ruby/1.8/gems/sequel-2.12.0/lib/sequel/deprecated.rb:245:in 
`print'
test.rb:20
Sequel::PrettyTable#print is deprecated and will be removed in Sequel 3.0.  
require "sequel/extensions/pretty_table" first.
D:/Users/Luis/.gem/ruby/1.8/gems/sequel-2.12.0/lib/sequel/deprecated.rb:304:in 
`print'
D:/Users/Luis/.gem/ruby/1.8/gems/sequel-2.12.0/lib/sequel/deprecated.rb:246:in 
`print'
test.rb:20
+--+----+----------------+
|id|name|price           |
+--+----+----------------+
| 3|ghi |         76.3733|
| 2|def |         60.0457|
| 1|abc |         26.7445|
+--+----+----------------+
The average price is: 54.3878553800661

l...@keore (D:\Users\Luis\Desktop)
$ gem --version
1.3.2

l...@keore (D:\Users\Luis\Desktop)
$ ruby -v
ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mingw32]

sqlite3-ruby (1.2.4)
sequel (2.12.0)


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=25541&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to