/usr/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no
implicit conversion from nil to integer (TypeError)
mentioned later in the post is more annoying - not least because it came back after I already got rid of it once! I have a hunch that this error can be triggered by the content of the html being generated by rcov, and in my case it was triggered by a test requiring a missing file. At first I didn't realise this was the problem of course, and the trace didn't give me a clue about which test caused the problem. The proximate cause lies in a method called wrap in /usr/local/lib/ruby/1.8/rexml/formatters/pretty.rb.
After messing around for a bit i found I that changing the wrap method to return just a string worked fine
def wrap(string, width)
# Recursively wrap string at width.
return string
end
This gave me an error that identified that culprit test. I could then fix the path to the missing file, change pretty.rb back to the original version, and carry on ...