[Rails 4.1] Sprockets error: Asset filtered out and will not be served
DanielKehoe opened this issue · 0 comments
DanielKehoe commented
When using Foundation with Rails 4.1.0, when visiting any page of the rails-foundation example app, I get this error:
Sprockets::Rails::Helper::AssetFilteredError at /
Asset filtered out and will not be served: add `config.assets.precompile += %w( vendor/modernizr )` to `config/application.rb` and restart your server
This is because sanity checks from the sprockets_better_errors gem have been merged into Rails 4.1. The intent is to reveal asset pipeline errors that you would see in production when you run the app in development mode. See rails/sprockets-rails#84
To resolve this, the rails_layout gem should update the config/application.rb file to include:
config.assets.precompile += %w( vendor/modernizr )
Note that the filename should not include the .js file extension.