Installation
This guide covers how to install Propshaft in new and existing Rails applications.
New Rails Applications
Rails 8+
With Rails 8, Propshaft is the default asset pipeline. When you create a new Rails 8 application, Propshaft is included and configured automatically.
rails new myapp
Rails 7
For Rails 7, you can create a new application with Propshaft by using the -a or --asset-pipeline flag:
rails new myapp -a propshaft
This command sets up your new application with Propshaft instead of the default Sprockets.
Existing Applications
If you have an existing Rails application, migrating to Propshaft from Sprockets requires a few steps, especially if you rely on Sprockets for transpiling assets like CoffeeScript or Sass. Propshaft is designed to work alongside modern JavaScript and CSS bundling tools.
For a detailed, step-by-step guide on migrating from a Sprockets-based setup, please see the Migrating from Sprockets guide.
Manual Installation
If you are setting up an application manually, you can add Propshaft to your Gemfile:
gem "propshaft"
Then, run Bundler to install the gem:
bundle install
You will also need to ensure your application is configured to use Propshaft. In config/application.rb, make sure you are not requiring sprockets/railtie if you intend to replace it completely.
Dependencies
Propshaft has the following core gem dependencies, which are managed automatically by Bundler:
actionpack (>= 7.0.0)activesupport (>= 7.0.0)rack
These dependencies ensure seamless integration with the Rails framework.