Precompiling assets with Capistrano 3 and Rails 4

A short note about a problem I had getting Capistrano to precompile assets …

I’m using Rails 4 and Capistrano 3 and the instructions for precompiling assets on the production server confused me !  The command cap production deploy does not precompile the Rails assets (Javascript and CSS).   The Capfile generated by the ‘capify’ command contains something like this;

The link to github does not exist, but this one does, https://github.com/capistrano/rails/

So I uncommented the line

and added gem ‘capistrano-rails’ to the Gemfile.

Then deployed the app and ran an extra cap task to precompile the assets.  I can’t think when I’d want to deploy without doing a precompile.

  cap production deploy

  cap production deploy:compile_assets

About OldGuy