Prior to Rails 3.1 these features were added through third-party Ruby libraries such as Jammit and Sprockets. Rails 3.1 is integrated with Sprockets through Action Pack which depends on the sprockets gem, by default.
Since, asset precompilation is now core feature of rails, the asset pipeline is active by default for Development Environment. Any files within app/assets folder will be precompiled by the asset pipeline. You can turn it off by adding below line to your configuration file for production, staging, development or whatever it is.
# By default it is true for Development Environment and false for other
public/assets. Sprockets returns a mapping table of the plain to fingerprinted filenames to Rails, and Rails writes this to the filesystem. The manifests.yml file is loaded into Memory by Rails at startup and cached for use by the asset helper methods.This makes the generation of pages with correct fingerprinted assets very fast, and the serving of the files themselves are web-server-from-the-filesystem fast. Both dramatically faster than live compiling.Set following configuration in production.rb environment file.
false# live compilation is disabled
config.assets.precompile += %w( search.js )
is say manifest file i,e it include list of other file...do not use this line if you do not have any left out manifest, search.js in my case. I have just mentioned it here as a example to precompile asset put in manifest different from the default one i,e application.css, application.js. All file you have included in
application.css and application.js will be precompiled by default. If something included in other file, say search.js , it can be included as here.
bundle exec rake assets:precompile RAILS_ENV=production
If you do not have write access to your production file system, you can call this task locally and then deploy the compiled assets.
bundle exec rake assets:precompile RAILS_ENV=development