在 Mac OS X 10.5.8 上使用 irb 运行 Geocommons Geocoder 时,SQLite3 中出现 NoMethodError (set_result)

发布于 2024-09-10 06:01:59 字数 2557 浏览 7 评论 0原文

这里是否有人在 Mac OS X 10.5 上安装并尝试运行 Geocommons geocoder 后遇到以下错误.8?这是我从启动 irb 时终端窗口的准确输出:

$ irb
>> require 'geocoder/us'
=> true
>> db = Geocoder::US::Database.new("/opt/tiger/orangeca.db")
=> #<Geocoder::US::Database:0x57ac10 @threadsafe=false, @db=#<SQLite3::Database:0x57ab98>, @debug=false, @st={}>
>> p db.geocode("Disneyland Anaheim, CA 92802")
NoMethodError: undefined method `set_result' for #<SQLite3::Database::FunctionProxy:0x576778>
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:64:in `tune'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/database.rb:316:in `call'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/database.rb:316:in `create_function'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `call'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `step'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `next'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:97:in `each'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:138:in `execute_statement'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:46:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:46:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:135:in `execute_statement'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:122:in `execute'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:151:in `places_by_zip'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:339:in `find_candidates'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:654:in `geocode_address'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:724:in `geocode'
from (irb):3>>  

顺便说​​一句,“orangeca.db”是加利福尼亚州奥兰治县的 TIGER/Line 数据 - 我只从主人口普查数据库下载了它,而不是整个数据美国数据集,因为我只是测试 Geocoder 对我想编写的一款软件的实用性,并且我不想花 10 个小时下载几 GB 的数据,而这些数据最终可能不会在最终产品中使用。

根据我在 SQLite3::Database::FunctionProxy 类上找到的信息,我对解释此行为的最佳猜测如下:

  1. 我的 SQLite3 安装正确,但某些配置不正确,导致我的地理编码器找不到所需的 set_result。
  2. 我的 SQLite3 安装不正确,但我不确定我的设置哪里出错了。

如果有人可以提供任何帮助,我将不胜感激。预先感谢您的帮助!

Has anyone here ever encountered the following error after installing and attempting to run the Geocommons geocoder on Mac OS X 10.5.8? This is my exact output from the Terminal window from the point at which I started irb:

$ irb
>> require 'geocoder/us'
=> true
>> db = Geocoder::US::Database.new("/opt/tiger/orangeca.db")
=> #<Geocoder::US::Database:0x57ac10 @threadsafe=false, @db=#<SQLite3::Database:0x57ab98>, @debug=false, @st={}>
>> p db.geocode("Disneyland Anaheim, CA 92802")
NoMethodError: undefined method `set_result' for #<SQLite3::Database::FunctionProxy:0x576778>
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:64:in `tune'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/database.rb:316:in `call'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/database.rb:316:in `create_function'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `call'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `step'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:66:in `next'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/resultset.rb:97:in `each'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:138:in `execute_statement'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:46:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:46:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:135:in `execute_statement'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:122:in `execute'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:151:in `places_by_zip'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:339:in `find_candidates'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:654:in `geocode_address'
from /Library/Ruby/Gems/1.8/gems/Geocoder-US-2.0.0/lib/geocoder/us/database.rb:724:in `geocode'
from (irb):3>>  

Incidentally, "orangeca.db" is the TIGER/Line data for Orange County, CA - I downloaded only it from the main Census database rather than the entire US dataset because I'm merely testing Geocoder's usefulness for a piece of software I want to write and I didn't want to spend 10 hours downloading several GB of data which I might not end up using in the final product anyway.

My best guesses at explaining this behavior, based on information I found on the SQLite3::Database::FunctionProxy class, are as follows:

  1. My SQLite3 is installed correctly but something is incorrectly configured such that my Geocoder is not finding set_result as desired.
  2. My SQLite3 is incorrectly installed, but I am not sure where I went wrong in setting it up.

If anyone could offer any help with this, I would greatly appreciate it. Thank you in advance for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情深已缘浅 2024-09-17 06:02:00

尝试使用此版本的 Sqlite Ruby Gem: http://github.com/schuyler/sqlite3-ruby< /a>

Try using this version of the Sqlite Ruby Gem: http://github.com/schuyler/sqlite3-ruby

临走之时 2024-09-17 06:02:00

您需要使用 1.2.5 版本的 sqlite3-ruby gem。

gem install sqlite3-ruby --version=1.2.5

您可以确保没有其他 gems 提供 sqlite3(例如 sqllite3 或 sqllite3-ruby 的较新版本),或者明确要求此 gem 的此版本。

You need to use the 1.2.5 version of the sqlite3-ruby gem.

gem install sqlite3-ruby --version=1.2.5

You can either make sure there is no other gems providing sqlite3 (such as sqllite3 or a newer version of sqllite3-ruby) or explicitly require this version of this gem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文