Skip to content
Latchkey

Ruby standardrb Version Mismatch Fails Lint in CI

standardrb bundles a fixed RuboCop ruleset per release, so a different standard version in CI enforces a different set of rules. The code is unchanged but a newer/older standard flags or unflags offenses, failing lint.

What this error means

standardrb passes locally and fails in CI (or vice versa) with offenses no one introduced. Because Standard pins its own rules, a version gap between local and CI changes what is considered an offense.

standardrb output
standard: Use Ruby and RuboCop, but with one set of rules.
app/models/user.rb:22:5: Style/HashSyntax: ...
# local standard 1.35 passes; CI standard 1.39 flags it

Common causes

CI standard version differs from local

An unpinned or globally installed standard in CI differs from the locked one. Standard ships its ruleset with each version, so the offense set changes with the version.

standard plugin versions drift

standard-rails or other plugins at different versions add or change rules, so CI and local disagree even when the core standard version matches.

How to fix it

Pin standard and run via Bundler

Lock standard (and plugins) in the Gemfile and invoke through bundle exec so the ruleset is identical everywhere.

Gemfile / Terminal
# Gemfile
gem 'standard', '1.39.0', require: false
# CI / local
bundle exec standardrb

Upgrade standard intentionally

  1. Bump standard in one PR and fix or auto-correct the new offenses (standardrb --fix).
  2. Pin standard plugins to compatible versions.
  3. Never rely on a globally installed standard in CI.

How to prevent it

  • Pin standard and its plugins in the Gemfile and commit the lock.
  • Run bundle exec standardrb everywhere, never a global install.
  • Upgrade standard deliberately and auto-correct in the same PR.

Related guides

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