Tuesday, March 24, 2009

Problem with rcov and ruby 1.8.7

I'm running ruby 1.8.7 and got the following error when running rcov (

usr/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no implicit conversion from nil to integer (TypeError)

To fix it change the following line in lib/rcov/report.rb of your rcov gem

if RUBY_VERSION == "1.8.6" && defined? REXML::Formatters::Transitive

if ["1.8.7", "1.8.6"].include?(RUBY_VERSION) && defined? REXML::Formatters::Transitive

With that modification rcov runs without problems again.

1 comment:

Anonymous said...

This really worked perfectly!!!

Thanks a lot