Issues with RCov

Hi everyone,

I’m in the process of migrating a project from MRI Ruby to JRuby, and
I’m having lots of trouble to get RCov working. I’d be very grateful if
someone could shed a light on what I’m doing wrong.

I’ve read all the docs and basically tried 3 things:

  1. Installing rcov from Ruby Gems:

jruby -S gem install rcov

and I got:

Building native extensions. This could take a while…
/usr/local/jruby/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native
extensions. Check wiki.jruby.org for alternatives. (NotImplementedError)
from /usr/local/jruby/lib/ruby/1.8/mkmf.rb:1:in `require’
from extconf.rb:1
ERROR: Error installing rcov:
ERROR: Failed to build gem native extension.

  1. Then I tried installing hooligan495-rcov (from github) using Ruby
    Gems. Again I got the same error

  2. Finally, I tried building rcov-java from source, either without
    options (crashes) or with --without-ext. In the latter case gets
    installed but crashes when I call it:

The rcovrt extension I found was built for a different version of rcov.
The required ABI is: 2.0.0
Your current rcovrt extension is: 0.0.0

Please delete rcovrt.{so,bundle,dll,…} and install the required one.

Since the rcovrt extension couldn’t be loaded, rcov will run in
pure-Ruby
mode, which is about two orders of magnitude slower.

If you’re on win32, you can find a pre-built extension (usable with
recent
One Click Installer and mswin32 builds) at
eigenclass.org .

/usr/local/jruby/lib/ruby/site_ruby/1.8/rcov.rb:654:in aggregate_data': NilClass can't be coerced into Fixnum (TypeError) from /usr/local/jruby/lib/ruby/site_ruby/1.8/rcov.rb:654:in each’
from /usr/local/jruby/lib/ruby/site_ruby/1.8/rcov.rb:654:in
`each_with_index’

Thanks in advance

  • abc