I am new to ruby and am playing around with the gem to access some of the data from the Guardian UKs open platform – contentapi-ruby.
When running a test example I keep getting the error:
(TestSearchContent): RuntimeError: can't add a new key into hash during iteration.
Any ideas what I am doing wrong? What exactly does this error mean?
My code:
require 'guardian-content'
articles = GuardianContent::Content.search("Obama")
articles.each do |article|
puts article.title
puts article.url
end
Looks like there’s a bug in the library. You can fix it by applying this patch:
https://github.com/chrsgrrtt/contentapi-ruby/commit/46326bce44177d1b8287a4a7167c895531eac25a