I am trying to use CarrierWave with Amazon S3. When I try to upload a file, through a rake task, I get this error:
rake aborted!
Expected(200) <=> Actual(403 Forbidden)
My CarrierWave initializer looks like this:
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: MY_AWS_ACCESS_KEY_ID,
aws_secret_access_key: MY_AWS_SECRET_ACCESS_KEY
}
config.fog_directory = MY_BUCKET
config.fog_public = true
end
I do have real, hard-coded key/secret/bucket values set while I'm debugging this.
The rake task looks like this, and is successful when I have the CarrierWave uploader set to upload locally with storage: file
:
Photo.create({
image: File.new('lib/dummy_files/image.jpg')
})
Any help is much appreciated. Thanks!