0 votes
1 view
in AWS by (19.2k points)

I have an application which is deployed to Heroku using amazon s3 posting images to buckets. This works perfectly fine. But when fetching the same image it gives an error:

Errno::ENOENT (No such file or directory showing path s3.amazonaws.com/bucket_name/app/public/messages/images/000/000/061/thumb/images.jpeg?1362410115)

Same path copying and pasting in the browser's URL doesn't work. If I am using bucket name as endpoint it works ie, with the following path


But I don't know how to configure this URL in my model. I am following Heroku's way to configure aws-sdk.


The model has_attached_file seems like I am missing something here. For the rest of the configuration, you can check the above link.

has_attached_file :image, :styles => { :medium => "100x100>", :thumb => "100x100>" }

1 Answer

0 votes
by (44.6k points)

Adding this code in config/initializers/paper_clip.rb solved the issue.


        :url => ':s3_domain_url',

        :path => 'app/public/:class/:attachment/:id_partition/:style/:filename'


Welcome to Intellipaat Community. Get your technical queries answered by top developers !