From 83c729ff6a4ff82bc0c0790118e3b959e617146c Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sun, 16 Feb 2020 08:01:24 -0600 Subject: [PATCH] Load JRuby ext under JRuby --- lib/ffi.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ffi.rb b/lib/ffi.rb index 361e53d70..7d97ca498 100644 --- a/lib/ffi.rb +++ b/lib/ffi.rb @@ -8,6 +8,10 @@ require 'ffi/ffi' +elsif RUBY_ENGINE == 'jruby' + JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService") + require 'ffi/ffi' + elsif defined?(RUBY_ENGINE) # Remove the ffi gem dir from the load path, then reload the internal ffi implementation $LOAD_PATH.delete(File.dirname(__FILE__))