问题
In rails console, I do:
s3 = Aws::S3.new(APP_CONFIG['amazon_access_key_id'], APP_CONFIG['amazon_secret_access_key'])
s3.delete('bucketname', 'uploads/users/14/photo/33/foo.jpg')
I get:
NoMethodError: undefined method `delete' for #<Aws::S3:0x0000010650b228>
I read this doc. Am I missing something?
回答1:
s3 = Aws::S3.new(APP_CONFIG['amazon_access_key_id'], APP_CONFIG['amazon_secret_access_key'])
s3.bucket('bucketname').delete_key('uploads/users/14/photo/33/foo.jpg')
来源:https://stackoverflow.com/questions/7390827/trying-to-delete-a-file-with-the-aws-gem