Since I updated several gems all tests fail with the error:
ActionView::Template::Error: Asset was not declared to be precompiled in production.
Add
Rails.application.config.assets.precompile += %w( favicons/manifest.json.erb )
toconfig/initializers/assets.rb
and restart your serverapp/views/layouts/_faviconsheader.html.erb:14:in
_app_views_layouts__faviconsheader_html_erb__1320
app/views/layouts/application.html.erb:21:in
_app_views_layouts_application_html_erb__4340
The error seems to refer to the partial _faviconsheader.html.erb
that includes the line:
<%= content_tag :link, nil, rel: :manifest, href: image_path("favicons/manifest.json.erb") %>
This partial is loaded in application.html.erb
: <%= render partial: 'layouts/faviconsheader' %>
.
Any idea what is causing this error and what to do? Before the gem update all tests passed.
I use Rails 4.2.5. One of the gems updated was sprockets
(updated sprockets to version 3.5.2). I read something on github about sprockets 4 having a problem, but I'm not using version 4.
P.S. Even if I add Rails.application.config.assets.precompile += %w( favicons/manifest.json.erb )
to config/initializers/assets.rb
the error persists. But even if that would have worked I would have wanted to understand why this problem has come about, without any changes except updating some gems.