I got this error Missing required arguments: aws_access_key_id, aws_secret_access_key
. That seems weird because I already added carrierwave.rb in initializers folder. The access/secret key works perfectly when I use aws-sdk
CarrierWave.configure do |config|
config.fog_credentials = {
provider: "AWS",
aws_access_key_id: ENV["PUB-KEY"],
aws_secret_access_key: ENV["SEC-KEY"]
}
config.fog_directory = ENV["mybucket"]
end
Here's what my working one looks like:
For production, I added the keys
S3_KEY
,S3_SECRET
andS3_BUCKET
. For development and testing, I used an initializer that is in a.gitignore
file:and in the initializer
Production and development configurations are different. You need to put AWS keys in development too.
I just copied AWS keys from
to
And everything worked fine.