diff options
Diffstat (limited to 'ext/psych/lib/psych.rb')
-rw-r--r-- | ext/psych/lib/psych.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 9959320a7f..e93ac8f406 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -1,11 +1,15 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/versions' case RUBY_ENGINE when 'jruby' require 'psych_jars' org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false) else - require 'psych.so' + begin + require "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so" + rescue LoadError + require 'psych.so' + end end require 'psych/nodes' require 'psych/streaming' |