I'm migrating my user-uploaded files to a S3 bucket. They were successfully migrated thanks to this question, or so I think, as they are all listed in my bucket's dashboard. Then I followed this, this and this guides to set up S3 integration. My Gemfile
looks like this:
(...)
#Image upload
gem 'paperclip'
gem 'aws-s3' # gem 'aws-sdk' won't work either
(...)
config/initializers/paperclip.rb
:
Paperclip::Attachment.default_options[:path] = "/:class/:attachment/:id_partition/:style/:filename"
Paperclip::Attachment.default_options[:s3_host_name] = "sa-east-1.amazonaws.com"
Paperclip::Attachment.default_options[:url] = ":s3_path_url"
config/environments/development.rb
and config/environments/production.rb
both end with this configuration:
config.paperclip_defaults = {
:storage => :s3,
:s3_credentials => {
:bucket => "MY_BUCKET",
:access_key_id => "MY_ACCESS_ID",
:secret_access_key => "MY_SECRET"
}
}
But when I try to get my attachment URL, for example User.find(163).avatar.url
, it yields:
":s3_path_url?1405653975"
Any thoughts?