Exception: Sprockets::Rails::Helper::AssetNotPrecompiledError

Inherits:
AssetNotPrecompiled show all
Includes:
Utils
Defined in:
lib/sprockets/rails/helper.rb

Instance Method Summary collapse

Methods included from Utils

#using_sprockets4?

Constructor Details

#initialize(source) ⇒ AssetNotPrecompiledError

Returns a new instance of AssetNotPrecompiledError.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sprockets/rails/helper.rb', line 14

def initialize(source)
  msg =
  if using_sprockets4?
    "Asset `#{ source }` was not declared to be precompiled in production.\n" +
    "Declare links to your assets in `app/assets/config/manifest.js`.\n\n" +
    "  //= link #{ source }\n\n" +
    "and restart your server"
  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