Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Dir.delete

Dir.delete( string ) → 0
Dir.rmdir( string ) → 0
Dir.unlink( string ) → 0

Deletes the named directory. Raises a subclass of SystemCallError if the directory isn’t empty.

See also .chroot .each_child .children .empty? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0