ruby/rubygems · error · Gem::Exception

Unable to find file for '#{spec.full_name}'

Error message

Unable to find file for '#{spec.full_name}'

What it means

Error "Unable to find file for '#{spec.full_name}'" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/source/local.rb:120

  def fetch_spec(name) # :nodoc:
    load_specs :complete

    if data = @specs[name]
      data.last.spec
    else
      raise Gem::Exception, "Unable to find spec for #{name.inspect}"
    end
  end

  def download(spec, cache_dir = nil) # :nodoc:
    load_specs :complete

    @specs.each do |_name, data|
      return data[0] if data[1].spec == spec
    end

    raise Gem::Exception, "Unable to find file for '#{spec.full_name}'"
  end

  def pretty_print(q) # :nodoc:
    q.object_group(self) do
      q.group 2, "[Local gems:", "]" do
        q.breakable
        if @specs
          q.seplist @specs.keys do |v|
            q.text v.full_name
          end
        end
      end
    end
  end
end

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. Reinstall the gem; its cached .gem file is missing from the cache directory

When it happens

Trigger: Thrown at lib/rubygems/source/local.rb:120 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/8e043dd14f10eafe. Report an issue: GitHub.