Isnor Creative
Isnor Creative Blog
Ruby, Ruby on Rails, Ember, Elm, Phoenix, Elixir, React, Vue

May 5, 2014

Ruby on Rails Paperclip Cloudfront Gotcha

Short story: turn on forward query string in CloudFront configuration

Long story: Had the damnedest time debugging an issue with Paperclip images not updating over the weekend. I’d done a number of updates recently, from Ruby 1.9.3 to Ruby 2.1.1, new version of Paperclip, as well as various feature releases, which served to, err cloud my judgement.

First I looked at our staging app, which runs on the same machine and configuration, and no problem there. Next looked to find out if the record was failing to save, that wasn’t the problem. Looked at user permission errors; imagemagick problems due to Ruby update; etc etc. Finally noted that my app was deleting a file that was different than the filename being referenced in the site. At that point it occurred to me that CloudFront was probably the issue. I dug around in the filesystem a bit, scp’d my files to localhost to take a look at them, found out that the images were being changed correctly. At that point it occurred to me that it was certainly a CloudFront issue.

Couldn’t find much documentation about this, but what ended up fixing the problem was going into our CloudFront configuration and enabling forwarding query strings.


I am available for Ruby on Rails consulting work – get in touch to learn more.

Gordon B. Isnor

Gordon B. Isnor writes about Ruby on Rails, Ember.js, Elm, Elixir, Phoenix, React, Vue and the web.
If you enjoyed this article, you may be interested in the occasional newsletter.

I am now available for project work. I have availability to build greenfield sites and applications, to maintain and update/upgrade existing applications, team augmentation. I offer website/web application assessment packages that can help with SEO/security/performance/accessibility and best practices. Let’s talk

comments powered by Disqus