Active Storage Is a Boundary Decision
See how Active Storage balances local simplicity, durable object storage, and preview-processing dependencies so you can choose the right boundary for a Rails file workflow.
HerokuRichard SchneemanTutorial
Rails 5.2’s Active Storage adds file uploads and attachments for Active Record models, with backing services such as AWS S3 and previews for PDFs and videos, but its beta PDF support depended on MuPDF. Security and legal review found MuPDF’s AGPL licensing could require commercial licensing, so Terence Lee updated Active Storage to support Poppler, an open-source PDF backend merged before release. Deployment guidance uses S3 through aws-sdk-s3, configures :amazon rather than the non-scalable local disk, and installs a custom buildpack containing FFmpeg and Poppler. The example Rails app attaches files to a Bulletin model, accepts uploads, and chooses PDF or video previews, image variants, or downloads according to available binaries and MiniMagick.
The beta version of Rails 5.2 used MuPDF for PDF previews, but security and legal review identified AGPL licensing that requires a commercial license for some uses. The post also addresses deploying Active Storage on Heroku, where local dyno storage is non-scalable and ephemeral.
Active Storage was updated to support Poppler as an open-source alternative to MuPDF. The deployment setup uses S3 for shared file storage and a custom Heroku buildpack to install FFmpeg and Poppler, while the example app attaches uploads to a Bulletin model and selects previews, image variants, or downloads based on available support.
MuPDF’s AGPL license requires a commercial license for some uses; Poppler was added as an open-source backend for Rails PDF previews.
Production deployments should configure Active Storage with the :amazon S3 service instead of :local, because dyno disks are not shared and are cleared on restart.
Active Storage reports PDFs and videos as previewable when the required binaries are installed, while image variants require MiniMagick; unsupported files are offered as downloads.
Summaries are generated from the original by a language model. Check the original before relying on it.
See the idea
See how Active Storage balances local simplicity, durable object storage, and preview-processing dependencies so you can choose the right boundary for a Rails file workflow.
Keep reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
One useful email. Unsubscribe anytime.