alexreisner / geocoder

Complete Ruby geocoding solution.
http://www.rubygeocoder.com
MIT License
6.34k stars 1.19k forks source link

request.location nil and timeout error #770

Closed shefalee1 closed 9 years ago

shefalee1 commented 9 years ago

request.location given nil often and getting timeout error still after adding geocoder configuration timeout to 20. And one more thing , Geocoder.search("23.3.4.5") when trying this , getting error Geocoding API's response was not valid JSON. => [ ]

webgem-jpl commented 9 years ago

I got the same issue. It was working before now it fails.

chesterl commented 9 years ago

Also reported here http://stackoverflow.com/questions/27519219/geocoder-not-working-properly-with-rails-4

I am also experiencing the same issue and first found that my ip addresses were not being GC after entered into the database.

alexreisner commented 9 years ago

This is not a problem with Geocoder, it's an issue with the freegeoip service. Please try a different IP address geocoding service, eg:

Geocoder.configure(ip_lookup: :telize)

If you need higher availability service you'll need to pay for host a database locally.

ahmadhasankhan commented 9 years ago
FATAL -- : 
ActionView::Template::Error (Please specify a valid lookup for Geocoder (:telize is not one of: :dstk, :esri, :google, :google_premier, :yahoo, :bing, :geocoder_ca, :geocoder_us, :yandex, :nominatim, :mapquest, :ovi, :baidu, :test, :freegeoip, :maxmind).):
alexreisner commented 9 years ago

:ip_lookup, not :lookup

ahmadhasankhan commented 9 years ago

Yep got that working, but the result is not accurate, Google is giving me correct city but telize is not.

glacerenza commented 9 years ago

Is it possible that with Telize as Ip Lookup, request.location is not working?

ImtiazEmu commented 9 years ago

@ahmadhasankhan , I got the same problem. I'm using telize and its not giving me the right location? Do I need to use a different ip_lookup? Google is accurate but once in a month google update their service (I believe) and the day they are updating, the service is unavailable for that day. Could you recommend me a better solution? Thanks in advance!

aashish commented 8 years ago

I am having same problem.

 :004 >   Geocoder.configure(ip_lookup: :telize) 
 => {:timeout=>20, :lookup=>:yandex, :ip_lookup=>:telize, :language=>:en, :http_headers=>{}, :use_https=>false, :http_proxy=>nil, :https_proxy=>nil, :api_key=>nil, :cache=>nil, :cache_prefix=>"geocoder:", :always_raise=>[], :units=>:km, :distances=>:linear} 
 :005 > Geocoder.search("hyderabad")
Geocoding API's response was not valid JSON.
 => [] 
 :006 > 
 :007 >   g =Geocoder.search("137.118.141.50")

Geocoding API's response was not valid JSON.
 => [] 
alexreisner commented 8 years ago

@aashish please see #950. You'll need to install from master until new gem is released (which will be very soon).