2013-10-07 2 views
1

눈금 1.0.0.pre2를 사용합니다. Google에서 인식하지 못하는 일부 주소를 찾으려고 할 때 격자는 예외를 발생시킵니다.격자 및 레일즈 : REXML :: ParseException : 속성 값이 누락되었습니다

LibXML::XML::Error in Cms/storesController#update 

Fatal error: Extra content at the end of the document at :1. 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/google.rb:82:in `prepare_response' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/base.rb:83:in `get' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/google.rb:36:in `locate' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable/geocode.rb:31:in `create_from_location' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable/geocode.rb:27:in `find_or_create_by_location' 
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable.rb:262:in `attach_geocode' 
... 
... 

Google 서비스를 사용하고 있습니다. 이는 예외를 생성하는 응답입니다.

"<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/><title>Sorry...</title><style> body { font-family: verdana, arial, sans-serif; background-color: #fff; color: #000; }</style></head><body><div><table><tr><td><b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font></b></td><td style=\"text-align: left; vertical-align: bottom; padding-bottom: 15px; width: 50%\"><div style=\"border-bottom: 1px solid #dfdfdf;\">Sorry...</div></td></tr></table></div><div style=\"margin-left: 4em;\"><h1>We're sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.</p></div><div style=\"margin-left: 4em;\">See <a href=\"http://www.google.com/support/bin/answer.py?answer=86640\">Google Help</a> for more information.<br/><br/></div><div style=\"text-align: center; border-top: 1px solid #dfdfdf;\">&copy; 2009 Google - <a href=\"http://www.google.com\">Google Home</a></div></body></html>" 

다른 주소로도 응답합니다! 그 예외를 어떻게 막을 수 있습니까?

답변

0

동일한 오류가 발생했습니다. Pry Debugger를 사용하여 happy mapper의 Parse 선언 아래에 binding.pry를 배치했습니다. 당신을 위해 그

/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse' 

재시작하는 놀리려는를하고 디버거 내가 구글에서 HTML 덤프를 수신하기 위해 XML 변수의 덤프를 한 직후

def parse(xml, options = {}) 

중지

location = geocoder.locate("61 East 9th Street, Holland, MI") 

실행 것 해당 메시지가 포함 된 메시지

<h1>We're sorry...</h1> 
<p>... but your computer or network may be sending automated queries. 
To protect our users, we can't process your request right now.</p> 
See <a href="https://support.google.com/websearch/answer/86640"> 
    Google Help 
</a> for more information. 

아직 해결되지 않았지만 이것이 문제입니다.