To delete a folder in Ruby you can use the following snippet.

Sample Ruby

import os 
os.rmdir(ourdir) #use with an empty dir

import shutil 
shutil.rmtree(ourdir) #use with a non empty dir

One thought on “How to delete a folder in Ruby”

Leave a Reply