TargetRubyVersion 参数,在 AllCops Not Working 下

问题描述

当我对文件运行 rubocop 时,我收到以下警告:

(Using Ruby 2.5 parser; configure using TargetRubyVersion parameter,under Allcops)

我在 .rubocop.yml 文件添加了以下内容

Allcops:
  TargetRubyVersion: 2.5.8

警告仍然没有消失。我做错了什么?

解决方法

配置文件应命名为 .rubocop.yml(前面的点)。