ruby/rubygems · error · Gem::InstallError

#{spec.name} requires #{dependency}

Error message

#{spec.name} requires #{dependency}

What it means

Error "#{spec.name} requires #{dependency}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/installer.rb:371

      Gem::Util.glob_files_in_dir("*.gemspec", File.join(gem_home, "specifications")).each do |path|
        spec = Gem::Specification.load path
        specs << spec if spec
      end

      specs
    end
  end

  ##
  # Ensure that the dependency is satisfied by the current installation of
  # gem.  If it is not an exception is raised.
  #
  # spec       :: Gem::Specification
  # dependency :: Gem::Dependency

  def ensure_dependency(spec, dependency)
    unless installation_satisfies_dependency? dependency
      raise Gem::InstallError, "#{spec.name} requires #{dependency}"
    end
    true
  end

  ##
  # True if the gems in the system satisfy +dependency+.

  def installation_satisfies_dependency?(dependency)
    return true if @options[:development] && dependency.type == :development
    return true if installed_specs.detect {|s| dependency.matches_spec? s }
    return false if @only_install_dir
    !dependency.matching_specs.empty?
  end

  ##
  # The location of the spec file that is installed.
  #

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. Install the missing dependency shown in the message first
  2. Update the gem (or RubyGems) so a compatible dependency version can be resolved

When it happens

Trigger: Thrown at lib/rubygems/installer.rb:371 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/e3629629c2e6ee60. Report an issue: GitHub.