使用依赖于 HTTParty 和 multi_xml 的 gem 时出现此错误:
MultiXml::ParseError: xmlParseCharRef: invalid xmlChar value 25
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/multi_xml-0.5.5/lib/multi_xml/parsers/nokogiri.rb:15:in `parse'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/multi_xml-0.5.5/lib/multi_xml.rb:138:in `parse'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/parser.rb:111:in `xml'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/parser.rb:140:in `parse_supported_format'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/parser.rb:102:in `parse'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/parser.rb:66:in `call'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/request.rb:241:in `parse_response'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/request.rb:211:in `block in handle_response'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/response.rb:18:in `call'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/response.rb:18:in `parsed_response'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/httparty-0.8.3/lib/httparty/response.rb:51:in `method_missing'
from /Users/chad/.rvm/gems/ruby-1.9.3-p194/gems/commission_junction-1.5.0/lib/commission_junction.rb:146:in `link_search'
似乎这是一个编码问题,或者由于某个库不喜欢的某些字符。
我使用的 gem 是commission_junction。要解决这个问题,也许我需要分叉它并指定一些编码选项?我正在挖掘这里的代码。
我尝试使用最新的commission_junction 和HTTParty gems...没有帮助。