{"record":{"id":"c6da99b8ffb8b08a","repo":"ruby/rubygems","slug":"36","errorCode":"36","errorMessage":"Could not delete previous installation of `#{dir}`","messagePattern":"Could not delete previous installation of `#(.+?)`","errorType":"exception","errorClass":"Bundler::DirectoryRemovalError","httpStatus":null,"severity":"error","filePath":"lib/bundler/rubygems_gem_installer.rb","lineNumber":234,"sourceCode":"    end\n\n    def strict_rm_rf(dir)\n      return unless File.exist?(dir)\n      return if Dir.empty?(dir)\n\n      parent = File.dirname(dir)\n      parent_st = File.stat(parent)\n\n      if parent_st.world_writable? && !parent_st.sticky?\n        raise InsecureInstallPathError.new(spec.full_name, dir)\n      end\n\n      begin\n        FileUtils.remove_entry_secure(dir)\n      rescue StandardError => e\n        raise unless File.exist?(dir)\n\n        raise DirectoryRemovalError.new(e, \"Could not delete previous installation of `#{dir}`\")\n      end\n    end\n  end\nend\n","sourceCodeStart":216,"sourceCodeEnd":239,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/rubygems_gem_installer.rb#L216-L239","documentation":"Error \"Could not delete previous installation of `#{dir}`\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/rubygems_gem_installer.rb:234 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"}