On this page
Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class · Ruby 4.1
FrozenError
Raised when there is an attempt to modify a frozen object.
Example
[1, 2, 3].freeze << 4
raises the exception:
FrozenError: can't modify frozen Array