{"record":{"id":"bd2aad06acd74104","repo":"ruby/rubygems","slug":"could-not-find-spec-file-name-for-installation","errorCode":null,"errorMessage":"Could not find #{spec.file_name} for installation","messagePattern":"Could not find #(.+?) for installation","errorType":"exception","errorClass":"GemNotFound","httpStatus":null,"severity":"error","filePath":"lib/bundler/source/rubygems.rb","lineNumber":596,"sourceCode":"          Bundler.user_cache.join(\"gems\", cache_slug)\n        end\n      end\n\n      def extension_cache_slug(spec)\n        return unless remote = spec.remote\n        remote.cache_slug\n      end\n\n      # We are using a mutex to read and write from/to the hash.\n      # The reason this double synchronization was added is for performance\n      # and to lock the mutex for the shortest possible amount of time. Otherwise,\n      # all threads are fighting over this mutex and when it gets acquired it gets locked\n      # until a thread finishes downloading a gem, leaving the other threads waiting\n      # doing nothing.\n      def rubygems_gem_installer(spec, options)\n        @gem_installers_mutex.synchronize { @gem_installers[spec.name] } || begin\n          path = fetch_gem_if_possible(spec, options[:previous_spec])\n          raise GemNotFound, \"Could not find #{spec.file_name} for installation\" unless path\n\n          REQUIRE_MUTEX.synchronize { require_relative \"../rubygems_gem_installer\" }\n\n          installer = Bundler::RubyGemsGemInstaller.at(\n            path,\n            security_policy: Bundler.rubygems.security_policies[Bundler.settings[\"trust-policy\"]],\n            install_dir: rubygems_dir.to_s,\n            bin_dir: Bundler.system_bindir.to_s,\n            ignore_dependencies: true,\n            wrappers: true,\n            env_shebang: true,\n            build_args: options[:build_args],\n            bundler_extension_cache_path: extension_cache_path(spec),\n            build_extension: Bundler.settings[:no_build_extension] ? false : nil,\n            install_plugin: Bundler.settings[:no_install_plugin] ? false : nil\n          )\n          @gem_installers_mutex.synchronize { @gem_installers[spec.name] ||= installer }\n        end","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/source/rubygems.rb#L578-L614","documentation":"Error \"Could not find #{spec.file_name} for installation\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/source/rubygems.rb:596 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}