Rails: assets

By default, Rails assumes your assets are precompiled in the production environment. 

And this gives you the best performance.

To check, config.assets.compile should be set to false, e.g.

# config/environments/production.rb

config.assets.compile = false    # don’t compile at runtime. i.e. assets are precompiled

However, you will need to make sure your assets are precompiled. e.g. 

bundle exec rake assets:precompile

A bit of a pain if you have to do it manually. Fortunately, Capistrano has a recipe to handle this at deploy time.

http://stackoverflow.com/questions/7275636/rails-3-1-0-actionviewtemplateerrror-application-css-isnt-precompiled

Notes:

1. you can disable the asset pipeline while creating a new application by passing the —skip-sprockets option

2. You must have an ExecJS supported runtime in order to use CoffeeScript

More on the Asset pipeline here:

http://guides.rubyonrails.org/asset_pipeline.html

Leave a Reply

Your email address will not be published. Required fields are marked *