Skip to content
Latchkey

RuboCop cannot load .rubocop.yml (unrecognized cop) in CI

RuboCop validates .rubocop.yml before running. An unrecognized cop name, a missing required extension gem, or an unresolvable inherit_from makes it error out at config load, so no files are inspected.

What this error means

RuboCop fails with "unrecognized cop or department X found in .rubocop.yml" or "cannot load such file" for a require: extension, and exits without linting.

RuboCop
Error: unrecognized cop or department Rails/TimeZone found in .rubocop.yml
Did you mean `Rails/TimeZone`? (obsolete `require: rubocop-rails` missing)

Common causes

A cop from an extension that is not required

Cops like Rails/*, RSpec/*, or Performance/* live in extension gems; without the matching require: (and gem installed), RuboCop does not recognize them.

A renamed cop or a broken inherit_from

A cop renamed across versions, or an inherit_from path that does not exist, makes config loading fail.

How to fix it

Install and require the extension

  1. Add the extension gem (for example rubocop-rails) to the Gemfile.
  2. Require it in .rubocop.yml under require: (or plugins:).
  3. Run bundle install, then re-run RuboCop.
.rubocop.yml
# .rubocop.yml
require:
  - rubocop-rails

Fix renamed cops and inherit paths

Update obsolete cop names to their new identifiers and correct any inherit_from paths so the config resolves.

How to prevent it

  • Keep extension gems in the Gemfile and required in config.
  • Pin RuboCop and its extensions together.
  • Run rubocop --lint config-style checks after upgrades.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →