End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
ENV.dup
ENV.dup # raises TypeError
hash.c
View on GitHub ↗
static VALUE
env_dup(VALUE obj)
{
rb_raise(rb_eTypeError, "Cannot dup ENV, use ENV.to_h to get a copy of ENV as a hash");
}