diff --git a/lib/compat/multi_json.rb b/lib/compat/multi_json.rb index 533938567..e62de7640 100644 --- a/lib/compat/multi_json.rb +++ b/lib/compat/multi_json.rb @@ -1,7 +1,10 @@ gem 'multi_json', '>= 1.0.0' require 'multi_json' -if !MultiJson.respond_to?(:load) || [Kernel, ActiveSupport::Dependencies::Loadable].include?(MultiJson.method(:load).owner) +if !MultiJson.respond_to?(:load) || [ + defined?(Kernel) && Kernel, + defined?(ActiveSupport::Dependencies::Loadable) && ActiveSupport::Dependencies::Loadable +].compact.include?(MultiJson.method(:load).owner) module MultiJson class <