# Google-geocode gem giving an error

**URL:** <https://discuss.rubyonrails.org/t/google-geocode-gem-giving-an-error/52956>\
**Category:** rubyonrails-talk\
**Created:** [July 15, 2010, 6:11am UTC](https://discuss.rubyonrails.org/t/google-geocode-gem-giving-an-error/52956 "2010-07-15T06:11:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [July 15, 2010, 6:11am UTC](https://discuss.rubyonrails.org/t/google-geocode-gem-giving-an-error/52956/1 "2010-07-15T06:11:12Z")

</div>

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' &nbsp;&nbsp;require 'google\_geocode' &nbsp;&nbsp;def index &nbsp;&nbsp;&nbsp;&nbsp;gg = GoogleGeocode.new "#{Api\_Key}" &nbsp;&nbsp;&nbsp;loc = gg.locate('Pune') &nbsp;&nbsp;&nbsp;puts loc.inspect &nbsp;&nbsp;end Whenever I running this code I getting following error "TypeError: can't convert String into Integer &nbsp;&nbsp;from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google\_geoc ode.rb:72:in `' &nbsp;&nbsp;from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google\_geoc ode.rb:72:in `check_error' &nbsp;&nbsp;from /usr/local/ruby/lib/ruby/gems/1.8/gems/rc-rest-4.0/lib/rc_rest.rb:128:in `get' &nbsp;&nbsp;from /usr/local/ruby/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google\_geoc ode.rb:51:in `locate' &nbsp;&nbsp;from (irb):7" Can anyone tell me what is the wrong with my code? Thanks, Tushar
