Description
At first glance this might be an obvious statement, however if you happen to end up with a config that falls through the below setup routine and ends up with an empty array, nothing works and nothing tells you why it's not working.
if config.assets.resolve_with.nil?
config.assets.resolve_with = []
config.assets.resolve_with << :manifest if config.assets.digest && !config.assets.debug
config.assets.resolve_with << :environment if config.assets.compile
end
I managed to hit this problem where someone set the assets debug flag in the initializer. When running in production mode the :manifest
option gets kicked out because of the debug flag and the :environment
option gets kicked out because the default option in rails is to not compile assets in production.
If :manifest
and :environment
are the only two available options for resolvers, and neither are picked up, something should throw a warning at some point that the pipeline isn't going to resolve any assets.
For search purposes this was causing ActionView::Template::Error (The asset "application.css" is not present in the asset pipeline.)
based on whatever was the first pipeline asset to be rendered