DBI and SQLite3

I'm trying to load an SQLite3 database with the DBI and I need some
help. Here's the setup I have and the error I'm getting:

the sqlite stuff:
sqlite test
SQLite version 2.8.17
Enter ".help" for instructions

.databases

seq name file
--- ---------------

···

----------------------------------------------------------
0 main /home/noob/test
1 temp /var/tmp/sqlite_nEeVH8LjfjhjMNv

select name, favnum from test;

Me>37
Fred>12
Pervert>69

#!/usr/bin/env ruby
require "dbi"

the script:
db = DBI.connect("DBI:SQLite3:main")
sth = db.execute("select * from test")

sth.fetch_hash do |row|
  puts row["name"] + "'s favorite number is " + row["favnum"].to_s
end

db.disconnect

the error:
ruby sqlite.rb
/usr/lib/ruby/1.8/DBD/SQLite3/SQLite3.rb:236:in `initialize': no such
table: test (DBI::ProgrammingError)
  from /usr/lib/ruby/1.8/DBD/SQLite3/SQLite3.rb:111:in `new'
  from /usr/lib/ruby/1.8/DBD/SQLite3/SQLite3.rb:111:in `prepare'
  from /usr/lib/ruby/1.8/dbi.rb:910:in `execute'
  from /usr/lib/ruby/1.8/dbi.rb:504:in `execute'
  from sqlite.rb:5
--
Posted via http://www.ruby-forum.com/\.

Dafydd Fontenot wrote:

the error:
ruby sqlite.rb
/usr/lib/ruby/1.8/DBD/SQLite3/SQLite3.rb:236:in `initialize': no such
table: test (DBI::ProgrammingError)
--

You might want to try "select tbl_name from sqlite_master where
type="table"" to see if there is really a table called "test".

···

--
View this message in context: http://www.nabble.com/DBI-and-SQLite3-tp24473539p24474525.html
Sent from the ruby-talk mailing list archive at Nabble.com.