我有一个使用scraperwiki
gem 的 Ruby 脚本。在此脚本的目录中,有一个名为scraperwiki.sqlite
.
items.each do |x|
if ScraperWiki.select("* from data where .... { x['key123']}'").empty?
ScraperWiki.save_sqlite(['key123'], x)
else
puts "Skipping already saved record " + record['key123']
end
end
但是,当我运行它时,我得到了一个错误:
/Users/alex/.rvm/gems/ruby-2.1.2/gems/sqlite_magic-0.0.3/lib/sqlite_magic.rb:49:in `rescue in execute': no such table: data (SqliteMagic::NoSuchTable)
from /Users/alex/.rvm/gems/ruby-2.1.2/gems/sqlite_magic-0.0.3/lib/sqlite_magic.rb:42:in `execute'
from /Users/alex/.rvm/gems/ruby-2.1.2/gems/scraperwiki-3.0.2/lib/scraperwiki.rb:186:in `select'