File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,25 @@ module Sprockets
7
7
module Rails
8
8
module Helper
9
9
class AssetNotPrecompiled < StandardError
10
+ include Sprockets ::Rails ::Utils
10
11
def initialize ( source )
11
- msg = "Asset was not declared to be precompiled in production.\n " +
12
- "Add `Rails.application.config.assets.precompile += " +
13
- "%w( #{ source } )` to `config/initializers/assets.rb` and " +
14
- "restart your server"
12
+ msg =
13
+ if using_sprockets4?
14
+ "Asset `#{ source } ` was not declared to be precompiled in production.\n " +
15
+ "Declare links to your assets in `assets/config/manifest.js`.\n " +
16
+ "Examples:\n " +
17
+ "`//= link ../javascripts/application.js`\n " +
18
+ "`//= link_directory ../javascripts .js`\n " +
19
+ "`//= link_directory ../stylesheets .css`\n " +
20
+ "`//= link_tree ../javascripts .js`\n " +
21
+ "`//= link_tree ../images`\n " +
22
+ "and restart your server"
23
+ else
24
+ "Asset was not declared to be precompiled in production.\n " +
25
+ "Add `Rails.application.config.assets.precompile += " +
26
+ "%w( #{ source } )` to `config/initializers/assets.rb` and " +
27
+ "restart your server"
28
+ end
15
29
super ( msg )
16
30
end
17
31
end
You can’t perform that action at this time.
0 commit comments