Precompiling Rails assets for production

Written on June 3, 2019

If you’re deploying your Rails application to a production environment, it’s ideal to precompile your assets. To do this, you’ll want to run,

RAILS_ENV=production rails assets:precompile

RAILS_ENV=production tells Rails to compile the production version of the assets.

assets:precompile is a Rails provided rake task that has instructions for compiling the assets.

Stay in touch

Thanks for reading this article. I'd love to stay in touch and share articles like this one in your inbox. Sign up for my newsletter.