ruby/rubygems · error · GemNotFound
Missing gem file '#{spec.file_name}'.
Error message
Missing gem file '#{spec.file_name}'. What it means
Error "Missing gem file '#{spec.file_name}'." thrown in ruby/rubygems.
Source
Thrown at lib/bundler/source/rubygems.rb:235
message += " with native extensions" if spec.extensions.any?
Bundler.ui.confirm message
installed_spec = nil
Gem.time("Installed #{spec.name} in", 0, true) do
installed_spec = installer.install
end
spec.full_gem_path = installed_spec.full_gem_path
spec.loaded_from = installed_spec.loaded_from
spec.base_dir = installed_spec.base_dir
spec.post_install_message
end
def cache(spec, custom_path = nil)
cached_path = Bundler.settings[:cache_all_platforms] ? fetch_gem_if_possible(spec) : cached_gem(spec)
raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path
return if File.dirname(cached_path) == Bundler.app_cache.to_s
Bundler.ui.info " * #{File.basename(cached_path)}"
FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
rescue Errno::EACCES => e
Bundler.ui.debug(e)
raise InstallError, e.message
end
def cached_built_in_gem(spec, local: false)
cached_path = cached_gem(spec)
if cached_path.nil? && !local
remote_spec = remote_spec_for(spec)
if remote_spec
cached_path = fetch_gem(remote_spec)
spec.remote = remote_spec.remote
else
Bundler.ui.warn "#{spec.full_name} is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it."
endView on GitHub (pinned to 86cbb817a3)
When it happens
Trigger: Thrown at lib/bundler/source/rubygems.rb:235 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/976827e57ce859d6.
Report an issue: GitHub.