{"record":{"id":"019d97fbfa82c8e0","repo":"ruby/rubygems","slug":"38","errorCode":"38","errorMessage":"Bundler cannot reinstall #{@name} because there's a previous installation of it at #{@path} that is unsafe to remove.\nThe parent of #{@path} is world-writable and does not have the sticky bit set, making it insecure to remove due to potential vulnerabilities.\nPlease change the permissions of #{File.dirname(@path)} or choose a different install path.","messagePattern":"Bundler cannot reinstall #(.+?) because there's a previous installation of it at #(.+?) that is unsafe to remove\\.\nThe parent of #(.+?) is world-writable and does not have the sticky bit set, making it insecure to remove due to potential vulnerabilities\\.\nPlease change the permissions of #(.+?) or choose a different install path\\.","errorType":"exception","errorClass":"Bundler::InsecureInstallPathError","httpStatus":null,"severity":"error","filePath":"lib/bundler/rubygems_gem_installer.rb","lineNumber":226,"sourceCode":"      # mode and raise \"IOError: not opened for writing\" when releasing slots.\n      [IO.new(read_fd.to_i, \"r\", autoclose: false), IO.new(write_fd.to_i, \"w\", autoclose: false)]\n    end\n\n    def prepare_extension_build(extension_dir)\n      SharedHelpers.filesystem_access(extension_dir, :create) do\n        FileUtils.mkdir_p extension_dir\n      end\n    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":208,"sourceCodeEnd":239,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/rubygems_gem_installer.rb#L208-L239","documentation":"Error \"Bundler cannot reinstall #{@name} because there's a previous installation of it at #{@path} that is unsafe to remove.\nThe parent of #{@path} is world-writable and does not have the sticky bit set, making it insecure to remove due to potential vulnerabilities.\nPlease change the permissions of #{File.dirname(@path)} or choose a different install path.\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/rubygems_gem_installer.rb:226 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"}