{"record":{"id":"be6ca3b951511e79","repo":"ruby/rubygems","slug":"installing-into-parent-path-s-of-s-is-not-allowe","errorCode":null,"errorMessage":"installing into parent path %s of %s is not allowed","messagePattern":"installing into parent path (.+?) of (.+?) is not allowed","errorType":"exception","errorClass":"Gem::Package::PathError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/package.rb","lineNumber":651,"sourceCode":"    @spec = nil\n    @files = []\n    raise\n  rescue Errno::ENOENT => e\n    raise Gem::Package::FormatError.new e.message\n  rescue Zlib::GzipFile::Error, EOFError, Gem::Package::TarInvalidError => e\n    raise Gem::Package::FormatError.new e.message, @gem\n  end\n\n  private\n\n  ##\n  # Returns the full path for installing +filename+ into +destination_dir+,\n  # which must already be resolved with File.realpath by the caller.\n  #\n  # If +filename+ is not inside +destination_dir+ an exception is raised.\n\n  def install_location(filename, destination_dir) # :nodoc:\n    raise Gem::Package::PathError.new(filename, destination_dir) if\n      filename.start_with? \"/\"\n\n    destination = File.expand_path(filename, destination_dir)\n\n    raise Gem::Package::PathError.new(destination, destination_dir) unless\n      normalize_path(destination).start_with? normalize_path(destination_dir + \"/\")\n\n    destination\n  end\n\n  ##\n  # Raises an exception unless +dir+, with symlinks resolved, is\n  # +destination_dir+ or a directory inside it.  +destination_dir+ must\n  # already be resolved with File.realpath by the caller.\n\n  def verify_extraction_dir(dir, destination_dir) # :nodoc:\n    real_dir = File.realpath(dir)\n","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/package.rb#L633-L669","documentation":"Error \"installing into parent path %s of %s is not allowed\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/package.rb:651 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not install this package: it contains an entry that would write outside the install directory","If you built the gem, fix the file list to remove parent-path entries and rebuild"],"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"}