NoMethodError (set_result) in SQLite3 when running Geocommons Geocoder using irb on Mac OS X 10.5.8

392 views Asked by At

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!

2

There are 2 answers

3
wonderchook On

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

0
christiangeek On

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.