Hi, I doing an integration my rails application with google map. For that I have installed the "google-geocode (1.2.1)" gem. I have written following code to get the longitude and latitude of the address.
require 'rubygems' require 'google_geocode' def index gg = GoogleGeocode.new "#{Api_Key}" loc = gg.locate('Pune') puts loc.inspect end
Whenever I running this code I getting following error "TypeError: can't convert String into Integer from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:72:in `' from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:72:in `check_error' from /usr/local/ruby/lib/ruby/gems/1.8/gems/rc-rest-4.0/lib/rc_rest.rb:128:in `get' from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:51:in `locate' from (irb):7"
Can anyone tell me what is the wrong with my code?
Thanks, Tushar