Disable frozen string literal comment checking

Adding rubocop.yml file not worked for me. It should be .rubocop.yml.

Create a .rubocop.yml file in the root directory of the Rails app and add the following code to disable frozen_string_literal check.

.rubocop.yml

Style/FrozenStringLiteralComment:
  Enabled: false

Further to this, If you don't want any magic frozen_string_literal comments, you can use this:

Style/FrozenStringLiteralComment:
  EnforcedStyle: never

This one worked for me

Style/FrozenStringLiteralComment:
  Enabled: false

You might want to add the following to your .rubocop.yml:

Style/FrozenStringLiteralComment:
  Enabled: false

Is it a bad idea to disable this cop? It depends. You probably want to revisit this before migrating to Ruby 3.0. But because Ruby 3.0 will not be released soon, there might be more important things to do in the meanwhile.