37

What are the available (best) ruby IP-based geolocation gem/plugins?

How do they compare to one another in terms of functionality, performance and ease of use (e.g. do they interact with a web service, or require a separate database, etc.) ?

I'm hoping anyone that has used some can share their experience and give recommendations.

JRL
  • 76,767
  • 18
  • 98
  • 146

5 Answers5

19

Your current best bet is probably GeoKit (http://github.com/andre/geokit-gem for gem, http://github.com/andre/geokit-rails for plugin). It has built in functionality for Yahoo and Google API keys, distance calculation helpers, reverse geolocation, etc.

However, GeoMereLaal (http://github.com/parolkar/geo_mere_laal/) is based on the working draft of the W3C Geolocaton API. It's very limited at the moment as I could only get it to work in Firefox, but it will be more accurate as it's supported by more browsers since it uses more methods of Geolocation (GPS, WiFi, cookies, IP).

mculp
  • 2,637
  • 1
  • 25
  • 34
  • 1
    I ended up using geokit-rails, and although I had some problems with installation (on Windows), I finally got it to work, and was satisfied with the result. – JRL Jan 05 '10 at 09:25
  • 3
    rubygeocoder.com is a more recent gem that does the same – Gady Nov 07 '11 at 10:30
  • GeoKit seems un-maintained at this point, not even a stable version for rails 3, just some abandoned fork. I will try with the suggestion from [this answer](http://stackoverflow.com/a/7335530/164989), [geocoder](https://github.com/alexreisner/geocoder) – opsidao Jul 04 '12 at 11:06
19

RubyGeocoder seems to be the current favorite and it's kept up to date. Comes complete with a railscast episode! http://rubygeocoder.com/

Danny
  • 3,982
  • 1
  • 34
  • 42
3

Easier to use and faster to set up, but with less features: http://humbuckercode.co.uk/licks/gems/geoip.

No external queries, no schema changes and quite fast.

Achilles
  • 766
  • 4
  • 13
2

Geocoder is a complete geocoding solution for Ruby. With Rails it adds geocoding (by street or IP address), reverse geocoding (find street address based on given coordinates), and distance queries. It’s as simple as calling geocode on your objects, and then using a scope like Venue.near("Billings, MT").

https://github.com/alexreisner/geocoder

Mr. Black
  • 11,692
  • 13
  • 60
  • 85
2

While I've never used it, Graticule looks promising.

Kyle Slattery
  • 33,318
  • 9
  • 32
  • 36