使用fog-aws
和asset_async
将所有资产上传到s3
当我尝试使用命令AssetSync.sync
或rake assets:precompile
这会引发错误
Excon::Error::Forbidden: Expected(200) <=> Actual(403 Forbidden)
excon.error.response
和
:body => "\nSignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.
IAM用户的政策
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::*"
},
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::yallamotor-static-assets"
},
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::yallamotor-static-assets/*"
}
]
}
`
如何解决此问题?