Senior & Expert RoR Developers Discussion Forum by Nyros Technologies

HIRE Ruby on Rails Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Getting the latitude and longitude using google geocode gem

 
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
View previous topic :: View next topic  
Author Message
jhonynil



Joined: 13 Nov 2007
Posts: 102

PostPosted: Thu May 28, 2009 9:20 am    Post subject: Getting the latitude and longitude using google geocode gem Reply with quote

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
View user's profile Send private message
Tushar



Joined: 15 Jul 2010
Posts: 1
Location: Pune

PostPosted: Thu Jul 15, 2010 7:13 am    Post subject: Getting latitude and longitude not working Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts How to customize Google Maps InfoWindow using ym4r_gm
0 kalyanallampalli 9 Thu Sep 02, 2010 5:34 pm
kalyanallampalli View latest post
No new posts Drag and Drop file upload
0 umamageshwari 19 Wed Sep 01, 2010 9:36 am
umamageshwari View latest post
No new posts Flex On Rails
0 Raghu 13 Wed Sep 01, 2010 3:00 am
Raghu View latest post
No new posts MongoDB
0 Raghu 17 Tue Aug 31, 2010 3:30 pm
Raghu View latest post
No new posts Problem with Dreamweaver / java error
3 Raja 19 Tue Aug 31, 2010 3:24 pm
Raghu View latest post
No new posts Generating Model
0 phani.galla 18 Tue Aug 31, 2010 2:09 pm
phani.galla View latest post
No new posts Hide Panels using JQuery
0 Anu 24 Tue Aug 31, 2010 1:50 pm
Anu View latest post
No new posts Load a text file using ajax in jquery
0 Anu 23 Tue Aug 31, 2010 1:39 pm
Anu View latest post
No new posts Generating Migrations
0 phani.galla 18 Tue Aug 31, 2010 1:38 pm
phani.galla View latest post
No new posts Generating Controllers
0 phani.galla 20 Tue Aug 31, 2010 1:22 pm
phani.galla View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More