diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb index ec7871dbea..8ac8b1c4ce 100644 --- a/tool/ruby_vm/helpers/dumper.rb +++ b/tool/ruby_vm/helpers/dumper.rb @@ -32,7 +32,8 @@ class RubyVM::Dumper rescue Errno::ENOENT raise "don't know how to generate #{path}" else - if RUBY_VERSION >= '2.6' + match = ERB.version.match(/\Aerb\.rb \[(?[^ ]+) /) + if match && match[:version] >= '2.2.0' # Ruby 2.6+ erb = ERB.new(src, trim_mode: '%-') else erb = ERB.new(src, nil, '%-')