If you are coding in Ruby 2.3 or newer, using RuboCop, you may have noticed this warning:

What is this? To improve performance, there were plans in Ruby 3 to use frozen string literals by default. In the end, this feature implementation was dropped. However, you can still use this magic comment, which must appear on the first line in the file, to declare your intention:
# frozen_string_literal: true
Since Ruby 2.3 if you run with –enable=frozen-string-literal all string literals are frozen by default. You can override this setting in a file with the same magic comment:
# frozen_string_literal: false
If you are not opting to use frozen string literals by default , you can still manually freeze them:
GREETING = "welcome".freeze
# if you try to modify the string, you will get a runtime error:
# can't modify frozen String: "welcome" (FrozenError)
GREETING.prepend("hi, ")