ruby/rubygems · error · Bundler::IncorrectLockfileDependencies

41

41

Error message

Bundler found incorrect dependencies in the lockfile for #{spec.full_name}

What it means

Error "Bundler found incorrect dependencies in the lockfile for #{spec.full_name}" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/lazy_specification.rb:273

        search.locked_platform = platform if search.instance_of?(RemoteSpecification) || search.instance_of?(EndpointSpecification)
      end
      search
    end

    # Validate dependencies of this locked spec are consistent with dependencies
    # of the actual spec that was materialized.
    #
    # Note that unless we are in strict mode (which we set during installation)
    # we don't validate dependencies of locally installed gems but
    # accept what's in the lockfile instead for performance, since loading
    # dependencies of locally installed gems would mean evaluating all gemspecs,
    # which would affect `bundler/setup` performance.
    def validate_dependencies(spec)
      if !@materialization_options[:strict] && spec.is_a?(StubSpecification)
        spec.dependencies = dependencies
      else
        if !source.is_a?(Source::Path) && spec.runtime_dependencies.sort != dependencies.sort
          raise IncorrectLockfileDependencies.new(self, spec.runtime_dependencies, dependencies)
        end
      end
    end
  end
end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/lazy_specification.rb:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/42ff51ba4645645b. Report an issue: GitHub.