Excon :: Error :: Forbidden:预期(200)<=>实际(403禁止)

时间:2019-03-05 19:26:03

标签: ruby-on-rails ruby amazon-web-services amazon-s3 fog

使用fog-awsasset_async将所有资产上传到s3 当我尝试使用命令AssetSync.syncrake assets:precompile

与s3异步资产时

这会引发错误

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/*"
        }
    ]
}

`

如何解决此问题?

0 个答案:

没有答案