我正在尝试将图片上传到s3,但我遇到了这个错误 “缺少必需的参数:aws_access_key_id,aws_secret_access_key”
class MyModel < ActiveRecord::Base
has_attached_file :attachment,
:storage => :fog,
:fog_credentials => {:provider => "AWS",
access_key_id: 'key_id',secret_access_key: 'access_key'},
:fog_directory => 'bucket_name'
end
答案 0 :(得分:1)
使用aws_access_key_id
中的aws_secret_access_key
和fog_credentials
选项代替access_key_id
和secret_access_key
。
has_attached_file :attachment,
:storage => :fog,
:fog_credentials => {:provider => "AWS",
aws_access_key_id: 'key_id',aws_secret_access_key: 'access_key'},
:fog_directory => 'bucket_name'
列表