| View previous topic :: View next topic |
| Author |
Message |
jhonynil
Joined: 13 Nov 2007 Posts: 102
|
Posted: Thu May 28, 2009 9:20 am Post subject: Getting the latitude and longitude using google geocode gem |
|
|
Install the google-geocode gem using the following command
gem install google-geocode
require 'rubygems'
require 'google_geocode'
gg = GoogleGeocode.new "BQIAAAAD--rNfRsxFXBkyC10976_RT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTihH9__YydGfcB4uwp5_oIvknXWg"
location = gg.locate 'United States'
p location.latitude.class
p location.longitude |
|
| Back to top |
|
 |
Tushar
Joined: 15 Jul 2010 Posts: 1 Location: Pune
|
Posted: Thu Jul 15, 2010 7:13 am Post subject: Getting latitude and longitude not working |
|
|
Hi,
I have used the code like this
require 'rubygems'
require 'google_geocode'
gg = GoogleGeocode.new "My APP Key"
location = gg.locate 'United States'
p location.latitude.class
p location.longitude
Whenever I rub this I am getting an error
can't convert String into Integer
/usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:74:in `[]'
/usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:74:in `check_error'
/usr/local/ruby/lib/ruby/gems/1.8/gems/rc-rest-4.0/lib/rc_rest.rb:128:in `get'
/usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:51:in `locate'
/home/Projects/googleMapDemo/app/controllers/google_map_controller.rb:8:in `index'
I already installed the google-geocode gem.
Can you tell me what is wrong with this?
Is there any other gem required to support
Thanks,
Tushar |
|
| Back to top |
|
 |
|