It has to do with your AWS settings, not Rails.
When creating a bucket, UNTICK “block all public access”:
See the difference of a public and a private bucket in the dashboard:
it can be something like
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": [
"arn:aws:s3:::awsexamplebucket1/"
]
}
]
}
CLICK HERE to find out more related problems solutions.