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
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.