I’m running Ruby 2.7.3 and I’m wondering if the above magic comment ‘encoding: utf-8’ is needed because Rubocop insists that its unnecessary.
It is not needed because the default encoding of source code files assumed by Ruby 2 is utf-8.
Rubocop suggest things. You are free to follow or not it’s directions. You can tune your Rubocop by telling it to ignore specific rules.