我在Ruby 1.9.3中使用Calais gem,当我使用以下代码片段时:
rdf = Calais.process_document(
:content => text,
:content_type => :html,
:license_id => 'xxxxxxxxxxxxxxxxxxxxxx',
# :output_format => :json,
:metadata_enables => ["SocialTags"]
)
我确信文本在那里。堆栈跟踪如下。有谁知道可能有什么不妥?
Completed 500 Internal Server Error in 39423ms
TypeError - can't convert nil into String:
(gem) calais-0.0.13/lib/calais/response.rb:92:in `parse'
(gem) calais-0.0.13/lib/calais/response.rb:92:in `block in extract_data'
(gem) nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each'
(gem) nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `upto'
(gem) nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `each'
(gem) calais-0.0.13/lib/calais/response.rb:90:in `extract_data'
(gem) calais-0.0.13/lib/calais/response.rb:29:in `initialize'
(gem) calais-0.0.13/lib/calais.rb:56:in `new'
(gem) calais-0.0.13/lib/calais.rb:56:in `process_document'