diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index 8a94e2337bf6e4..3f2d91ffa477e5 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -1521,4 +1521,6 @@ void Init_generator(void) usascii_encindex = rb_usascii_encindex(); utf8_encindex = rb_utf8_encindex(); binary_encindex = rb_ascii8bit_encindex(); + + rb_require("json/ext/generator/state"); } diff --git a/ext/json/lib/json/ext.rb b/ext/json/lib/json/ext.rb index 775e28a967a8ef..92ef61eaec0bf0 100644 --- a/ext/json/lib/json/ext.rb +++ b/ext/json/lib/json/ext.rb @@ -15,9 +15,6 @@ module Ext else require 'json/ext/parser' require 'json/ext/generator' - unless RUBY_ENGINE == 'jruby' - require 'json/ext/generator/state' - end $DEBUG and warn "Using Ext extension for JSON." JSON.parser = Parser JSON.generator = Generator