我正在尝试列出或从亚马逊存储桶中检索对象,但我一直收到以下错误消息:
(byebug) resp = s3.list_objects(bucket:'mp3list')
*** Aws::S3::Errors::PermanentRedirect Exception:
The bucket you are attempting to access must be addressed
using the specified endpoint.
Please send all future requests to this endpoint.
我可以轻松上传和删除同一存储桶中的文件。
有人知道如何指定该端点以及在哪里指定?
我的S3存储桶配置如下:
Bucket: mp3play
Region: Frankfurt
Creation Date: Fri Dec 09 17:44:39 GMT+100 2016
Owner: aaa
Can list, upload, delete.
aws.rb >
Aws.config.update({
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),
region: 'eu-central-1'
})
# list buckets in Amazon S3
s3 = Aws::S3::Client.new
resp = s3.list_buckets
S3_BUCKET = resp.buckets[0]
resp.buckets.map(&:name)
S3 = Aws::S3::Resource.new(region: 'eu-central-1')