{"record":{"id":"239f933cef70896a","repo":"ruby/rubygems","slug":"spec-name-spec-version-has-an-invalid-gemspe","errorCode":null,"errorMessage":"#{spec.name} #{spec.version} has an invalid gemspec","messagePattern":"#(.+?) #(.+?) has an invalid gemspec","errorType":"exception","errorClass":"Gem::InvalidSpecificationException","httpStatus":null,"severity":"error","filePath":"lib/bundler/installer.rb","lineNumber":224,"sourceCode":"      # their .gem files, so keep resolution memory around in that case.\n      # The bundler spec itself is excluded because it comes from the\n      # metadata source and never goes through that path.\n      @definition.release_resolution_memory! if specs.none? {|s| s.default_gem? && s.source.is_a?(Source::Rubygems) }\n      spec_installations = ParallelInstaller.call(self, specs, jobs, standalone, force, local: local)\n      spec_installations.each do |installation|\n        post_install_messages[installation.name] = installation.post_install_message if installation.has_post_install_message?\n      end\n    end\n\n    def load_plugins\n      Gem.load_plugins\n\n      requested_path_gems = @definition.specs.select {|s| s.source.is_a?(Source::Path) }\n      path_plugin_files = requested_path_gems.flat_map do |spec|\n        spec.matches_for_glob(\"rubygems_plugin#{Bundler.rubygems.suffix_pattern}\")\n      rescue TypeError\n        error_message = \"#{spec.name} #{spec.version} has an invalid gemspec\"\n        raise Gem::InvalidSpecificationException, error_message\n      end\n      Gem.load_plugin_files(path_plugin_files)\n      Gem.load_env_plugins\n    end\n\n    def ensure_specs_are_compatible!\n      overrides = @definition.overrides\n      @definition.specs.each do |spec|\n        unless spec.matches_current_ruby_with_overrides?(overrides)\n          raise InstallError, incompatibility_message(spec, \"requires ruby version #{spec.required_ruby_version}, \" \\\n            \"which is incompatible with the current version, #{Gem.ruby_version}\")\n        end\n        unless spec.matches_current_rubygems_with_overrides?(overrides)\n          raise InstallError, incompatibility_message(spec, \"requires rubygems version #{spec.required_rubygems_version}, \" \\\n            \"which is incompatible with the current version, #{Gem.rubygems_version}\")\n        end\n      end\n    end","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/installer.rb#L206-L242","documentation":"Error \"#{spec.name} #{spec.version} has an invalid gemspec\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/installer.rb:224 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"}