Yahoo BOSS geocode undefined method `[]' for nil:NilClass

51 Views Asked by At

Using Yahoo BOSS as a geocoding service with geocoder gem in my rails 4 project. Getting error..

 undefined method `[]' for nil:NilClass /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder/lookups/yahoo.rb:33:in `results'
 /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder/lookups/base.rb:47:in `search'
 /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder/query.rb:11:in `execute'
 /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder.rb:21:in `search'
 /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder/stores/base.rb:111:in `do_lookup'
 /Users/local/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/geocoder-1.2.8/lib/geocoder/stores/active_record.rb:259:in `geocode'

config.yml

Geocoder.configure({
  lookup: :yahoo,
  api_key: [APP_CONFIG["yahoo"]["consumer_key"], APP_CONFIG["yahoo"]["consumer_secret"]],
  use_https: true,
  always_raise: :all,
  cache: Rails.cache
})

Getting this error running import scripts manually from the rails console, trying to reverse geocode scraped event addresses to lat long.

Please let me know if more information is need. Pretty stumped on the issue and any advice will be greatly appreciated! Thanks!

1

There are 1 best solutions below

0
Nigel Earle On

Ran scripts again after waiting for about 30 min. Api just needs to time to provision. No errors.