geolocation_city

Requirements

Download the GeoIP C API from MaxMind, or install it via homebrew.

brew install geoip

Updating the .dat file

Don’t forget to include ‘geolocation_city/rake_task’ to your Rakefile.

rake geolocation:update target=Test.dat

Getting localization from an IP

require ‘geolocation_city’ geo = Geolocation::City.new(‘Test.dat’) geo.from_ip(‘24.24.24.24’)

Copyright © 2010 Iván Valdés (@ivanvc). See LICENSE for details.