Ask A Question

Notifications

You’re not receiving notifications from this thread.

Refile :fill does not work for me

Wes asked in Gems / Libraries

I have the refile gem connected with aws by following the instruction on their github. For an image i would get something like

/attachments/store/78b928c7897e3b12de80cf1ffdfdfdfdf/image.jpg

which works but when i try to use the :fill that refile provides my images don't display. You can see that i have the fill/400/400 in the url below.

/attachments/store/fill/400/400/78b928c7897e3b12de80cf1ffdfdfdfdf/image.jpg

I'm guessing that i have to change the way aws stores the image in this code.

require "refile/backend/s3"

aws = {
  access_key_id: "xyz",
  secret_access_key: "abc",
  bucket: "my-bucket",
}
Refile.cache = Refile::Backend::S3.new(prefix: "cache", **aws)
Refile.store = Refile::Backend::S3.new(prefix: "store", **aws)
Reply

I'm not quite sure how the AWS storage works with the resized images. I'm guessing it downloads a copy of the image to your server from S3 and then resizes it, but maybe it's slow to reprocess things.

I wouldn't consider myself a refile expert and I'm not using it in production anywhere, but I would post this on the Refile github issues: https://github.com/elabs/refile

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.