1

Is there a gem that can print my current location to the console? For instance, my longitude or latitude or even my street address without inputting anything?

I read the Google-Maps-for-Rails and Geocoder docs and I have to provide input like longitude and latitude to get the address and so forth. I don't want the user to have to input anything, as soon as they run the program their location prints out, have it be street address or longitude and latitude

Does anyone know of a another way other then Geocoder or gmaps4rails to accomplish this?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Calvin Jones
  • 357
  • 7
  • 19

1 Answers1

1

Using a gem like Geokit you can geocode your external IP address although the result isn't very accurate. If you need GPS accurate results you can tap into your systems geolocation e.g. on Mac: https://github.com/robmathers/WhereAmI

DiegoSalazar
  • 13,361
  • 2
  • 38
  • 55
  • yeah I tried that require 'geokit' include GeoKit::Geocoders but got a error saying uninitialized constant MultiGeocoder (NameError) basically from this thread http://stackoverflow.com/questions/4889599/rails-how-to-get-latitude-and-longitude-from-string-address-and-put-it-on-google – Calvin Jones Jan 28 '14 at 19:56