Rails 8 replaces Sprockets with Propshaft as the default asset pipeline. Propshaft is a lightweight pipeline focused solely on fingerprinting and serving assets, delegating bundling and transpilation to dedicated tools like esbuild or Import Maps. A step-by-step migration guide covers updating the Gemfile, installing npm packages, and migrating popular libraries including Bootstrap, jQuery, Select2, and Font Awesome from gem-based assets to npm packages. The guide also addresses handling gems without npm equivalents (like cocoon), CSS asset path changes, common errors and their fixes, and scenarios where staying with Sprockets may be preferable.
Table of contents
What is Propshaft?Migrating a Rails 7.1 app to PropshaftMigrating popular librariesHandling gems without npm equivalentsHandling CSS asset pathsUpdate layout and configurationCommon errors and fixesWhen to stay with SprocketsPros and consConclusionReferencesSort: