This is my very simple code to check whether an object exists in S3. I'm using the newest version of the aws-sdk for ruby.
Aws.config.update({region: 'us-west-2', credentials: Aws::Credentials.new( ENV['S3_ID'], ENV['S3_KEY']) })
s3 = Aws::S3::Resource.new
s3.bucket(ENV['S3_BUCKET']).object("uploads/IMG_5220.PNG").exists?
However when I run this code - I get back a very cryptic error NoMethodError: undefined method 'decode_content' for #<Net::HTTP::Head HEAD>
Here is a gist with the full stack trace - http://ift.tt/1KyuoJe
This is driving me nuts! Any help is much appreciated.
Aucun commentaire:
Enregistrer un commentaire