Exception: Sprockets::Rails::Helper::AssetNotPrecompiled
- Inherits:
-
StandardError
- Object
- StandardError
- Sprockets::Rails::Helper::AssetNotPrecompiled
- Includes:
- Utils
- Defined in:
- lib/sprockets/rails/helper.rb
Instance Method Summary collapse
-
#initialize(source) ⇒ AssetNotPrecompiled
constructor
A new instance of AssetNotPrecompiled.
Methods included from Utils
Constructor Details
#initialize(source) ⇒ AssetNotPrecompiled
Returns a new instance of AssetNotPrecompiled.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sprockets/rails/helper.rb', line 11 def initialize(source) msg = if using_sprockets4? "Asset `#{source}` was not declared to be precompiled in production.\n" + "Declare links to your assets in `assets/config/manifest.js`.\n" + "Examples:\n" + "`//= link ../javascripts/application.js`\n" + "`//= link_directory ../javascripts .js`\n" + "`//= link_directory ../stylesheets .css`\n" + "`//= link_tree ../javascripts .js`\n" + "`//= link_tree ../images`\n" else "Asset was not declared to be precompiled in production.\n" + "Add `Rails.application.config.assets.precompile += " + "%w( #{source} )` to `config/initializers/assets.rb` and " + "restart your server" end super(msg) end |