Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k 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

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.4k 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'


Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories