Google-geocode gem giving an error

2 views
Skip to first unread message

Tushar Gandhi

unread,
Jul 15, 2010, 2:11:12 AM7/15/10
to rubyonra...@googlegroups.com
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_geoc
ode.rb:72:in
`[]'
from
/usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geoc
ode.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_geoc
ode.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/.
Reply all
Reply to author
Forward
0 new messages