要获取S3密钥(非Rails blob密钥)以在Active Storage中使用,可以按照以下步骤操作:
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::/*"]
}]
}
config.active_storage.service = :amazon
config.aws_credentials = {
access_key_id: '',
secret_access_key: '',
region: ''
}
确保将
通过按照以上步骤操作,您应该能够成功获取S3密钥并在Active Storage中使用。
上一篇:ActiveStorage-无法找到或构建blob:预期的attachable,但得到了#<ActionDispatch::Http::UploadedFile
下一篇:ActiveStorage::AnalyzeJob:没有可用空间@io_write-/tmp/ActiveStorage-24615