{"record":{"id":"9760c3272e095895","repo":"ruby/rubygems","slug":"pre-install-hook-location-failed-for-spec-full","errorCode":null,"errorMessage":"pre-install hook#{location} failed for #{spec.full_name}","messagePattern":"pre-install hook#(.+?) failed for #(.+?)","errorType":"exception","errorClass":"Gem::InstallError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/installer.rb","lineNumber":322,"sourceCode":"    Gem::Specification.add_spec(spec) unless @install_dir\n\n    load_plugin unless options[:install_plugin] == false\n\n    run_post_install_hooks\n\n    spec\n  rescue Errno::EACCES => e\n    # Permission denied - /path/to/foo\n    raise Gem::FilePermissionError, e.message.split(\" - \").last\n  end\n\n  def run_pre_install_hooks # :nodoc:\n    Gem.pre_install_hooks.each do |hook|\n      next unless hook.call(self) == false\n      location = \" at #{$1}\" if hook.inspect =~ /[ @](.*:\\d+)/\n\n      message = \"pre-install hook#{location} failed for #{spec.full_name}\"\n      raise Gem::InstallError, message\n    end\n  end\n\n  def run_post_build_hooks # :nodoc:\n    Gem.post_build_hooks.each do |hook|\n      next unless hook.call(self) == false\n      FileUtils.rm_rf gem_dir\n\n      location = \" at #{$1}\" if hook.inspect =~ /[ @](.*:\\d+)/\n\n      message = \"post-build hook#{location} failed for #{spec.full_name}\"\n      raise Gem::InstallError, message\n    end\n  end\n\n  def run_post_install_hooks # :nodoc:\n    Gem.post_install_hooks.each do |hook|\n      hook.call self","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/installer.rb#L304-L340","documentation":"Error \"pre-install hook#{location} failed for #{spec.full_name}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/installer.rb:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or remove the failing pre-install hook (see the reported hook location)","Re-run with `-V` for verbose output to see why the hook failed"],"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"}