Turbo Sprockets for Rails 3.2.x
- Speeds up your Rails 3
rake assets:precompileby only recompiling changed assets, based on a hash of their source files
- Only compiles once to generate both fingerprinted and non-fingerprinted assets
Please test this out thoroughly on your local machine before deploying to a production site, and open an issue on GitHub if you have any problems. By using this software you agree to the terms and conditions in the MIT license.
All versions of Ruby that are supported by Rails
1.8.7 and REE.
This gem only supports Rails
3.2.0 or higher.
Just drop the gem in your
Warning: Don't add this gem to the
:assets group. It must be available in the production environment, since it overrides path helpers and alters the manifest format. This is a common cause of
**** isn't precompiled errors in production.
bundle to install the gem, and you're done!
Test it out by running
rake assets:precompile. When it's finished, your
public/assets/manifest.yml file should include a
:source_digests hash for your assets.
Go on, run
rake assets:precompile again, and it should be a whole lot faster than before.
Enjoy your lightning fast deploys!
Fully compatible. Just don't use the experimental
AssetSync.config.manifest = true configuration option until
my asset_sync patch has been merged.
Please let me know if you have any problems with other gems, and I will either fix it, or make a note of the problem here.
turbo-sprockets-rails3 should work out of the box with Capistrano.
You won't be able to do an 'incremental update' on heroku, since your
folder will be empty at the start of each push. However, this gem can still cut your
precompile time in half, since it only needs to compile assets once.
If you want to make the most of
turbo-sprockets-rails3, you can run
assets:precompile on your local machine and commit the compiled assets. When you push compiled assets to Heroku, it will automatically skip the
I've automated this process in a Rake task for my own projects. My task creates a deployment repo at
tmp/heroku_deploy so that you can keep working while deploying, and it also rebases and amends the assets commit to keep your repo's history from growing out of control. You can find the deploy task in a gist at https://gist.github.com/3802355. Save this file to
lib/tasks/deploy.rake, and make sure you have added a
heroku remote to your repo. You will now be able to run
rake deploy to deploy your app to Heroku.
If you would like to view debugging information in your terminal during the
assets:precompile task, add the following lines to the bottom of
config.log_level = :debug config.logger = Logger.new(STDOUT)