There are some gems/plugins available
1. Geokit https://github.com/ jlecour/geokit-rails3
2. Geoip https://github.com/ mtodd/geoip
3. Geomagic https://github.com/ kristianmandrup/geo_magic
4. Geo Location https://github.com/ chrisyour/geo_location
1. Geokit https://github.com/
2. Geoip https://github.com/
3. Geomagic https://github.com/
4. Geo Location https://github.com/
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. Also Can find basic information of an IP like street_address, city, state, zip etc. (As needed)
Please find details here http://geokit.rubyforge. org/api/geokit-gem/Geokit/ GeoLoc.html
Please find details here http://geokit.rubyforge.