bucket = AWS::S3::Bucket.find('the bucket name') while(!bucket.empty?) begin puts "Deleting objects in bucket" bucket.objects.each do |object| object.delete puts "There are #{bucket.objects.size} objects left in the bucket" end puts "Done deleting objects" rescue SocketError puts "Had socket error" end end
Quick loop to empty out your s3 bucket. Thanks to MattLor