All threads / S3 Storage and Active Storage Images not showing
Ask A Question

Notifications

You’re not receiving notifications from this thread.

S3 Storage and Active Storage Images not showing

Rob Thomas asked in Rails

Hey Guys,

I have S3 Storage all setup and things are workin as I am getting:

ActiveStorage::Blob Update (0.8ms)  UPDATE "active_storage_blobs" SET "metadata" = $1 WHERE "active_storage_blobs"."id" = $2 

in the terminal but my images are shouwing as broken images. Any ideas on how to fix this?

Did you figure this out? I'm having trouble setting up S3 to work with Active Storage on a Heroku environment.

Would you mind sharing your setup, please?

Check if you have rescue from routing error in your routes.rb

Something like this:

Rails.application.routes.draw do
match '*unmatched', to: 'application#route_not_found', via: :all
end

That prevents active storage path from accessing your stored image in S3, hence the broken image.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.