FredO
unread,May 18, 2012, 5:43:51 PM5/18/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to carrierwave
I have been experimenting with the basic S3 example in the Rails
console, and it doesn't seem to set the credentials in the uploader .
(BTW I am using mongoid, not that it should make a difference in this
example.)
I generated a PhotoUploader class as described in the instructions,
(setting storage to :fog), and put the following in application.rb:
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: StorageMgr.public_key("xxxxxx"),
aws_secret_access_key: StorageMgr.private_key("yyyyyy")
}
config.fog_directory = "my_directory"
end
If I create an instance of the PhotoUploader and examine the
creditials:
uploader.fog_credentials
=>
{:provider=>"AWS", :aws_access_key_id=>nil, :aws_secret_access_key=>nil}
Both the :aws_access_key_id and :aws_secret_access_keys are nil.
If I try and store a file, I get "Missing required arguments:
aws_access_key_id, aws_secret_access_key"
file = File.open "/tmp/my_picture.jpg"
s = uploader.store! file
ArgumentError: Missing required arguments: aws_access_key_id,
aws_secret_access_key
What am I missing here?