Search code examples
rubygemsjruby

jruby always shows, even a gem has been installed, but it's not


I'm trying to run a script, which uses a certain gem, via jruby. But it always shows that a gem, even after I've installed it, isn't installed.

% jruby ./examples/test1.rb
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1

% gem pristine ffi --version 1.13.1
Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored ffi-1.13.1
% jruby ./examples/test1.rb  
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1


% jruby -v
jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM 14.0.1+14 on 14.0.1+14 +jit [darwin-x86_64]

How to cure it?


Solution

  • might be worth reporting an issue to ffi, the gem declares an extension for it's -java gem variant but it only really provides and builds a native extension under MRI.