This example is taken directly from the Ruby 2.4.1 documentation, and I can confirm I am running 2.4.1:
({a: 1, b: 2, c: 3}).transform_keys {|k| k.to_s}
When I execute it, I receive the following error:
NoMethodError: undefined method `transform_keys' for {:a=>1, :b=>2, :c=>3}:Hash
Why is the transform_keys method not defined?