在rails控制台中,我这样做:
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')
我明白了:
NoMethodError: undefined method `delete' for #<Aws::S3:0x0000010650b228>
我读了这个doc。我错过了什么吗?
答案 0 :(得分:3)
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')