Closed djberg96 closed 2 years ago
The test suite of HexaPDF never ran successfully under JRuby. I just tried it out with the latest version 9.3.7.0 and it still has 72 errors, many of them begin exactly the one you encountered (undefined method
last' for <???>:Integer`).
It often comes down to this line (as with your case) which JRuby can't handle:
needed_bytes = (w0 + w1 + w2) * index.each_slice(2).sum(&:last)
I don't really know why it can't handle that line. And since I personally don't use JRuby and there was no need from somebody else, I didn't investigate. However, since the test suite runs fine on MRI and on TruffleRuby, my guess is that JRuby is not 100% compatible with MRI.
@gettalong Thanks, I've reported it at https://github.com/jruby/jruby/issues/7326.
I can re-open this issue if there is anything to do on HexaPDF's side.
Already fixed in JRuby. I'll try again when they push out a new release. :)
@djberg96 Great, thank you!
jruby 9.3.4.0 (2.6.8) 2022-03-23 eff48c1ebf OpenJDK 64-Bit Server VM 18.0.2+0 on 18.0.2+0 +jit [arm64-darwin] hexapdf 0.24.1
I was just tinkering with JRuby and hexapdf, but I noticed even a basic script like this fails:
Output:
It works fine with MRI. Any ideas?