title: Error Trying to delete s3 object with ruby
body: <p>Trying to delete a s3 object by using ruby with something like this:</p>
  
  <pre><code> After('@removeS3Files') do
    prefix = 'pifiles/files/'
  
    s3 = AWS::S3.new
    bucket = s3.buckets['scratching']
  
    if (defined?(s3files)).nil?
      s3files = []
    end
  
    s3files &lt;&lt; bucket.objects.with_prefix(prefix).collect(&amp;:key)
    s3files.each do |key|
      bucket.objects.delete(key)
    end
  end
  </code></pre>
  
  <p>I'm getting the error "Failed to delete 1 objects (AWS::S3::Errors::BatchDeleteError)"</p>