I was in the process of upgrading a Rails 5.0.1 app to Rails 5.1 and encountered some deprecation warnings. I was able to resolve all but one.
I did some searching around and didn't find a definitive answer.
This is an app that was just completed. I just updated the rails version to 5.1
I have some RSpec request specs. They test redirection in (Devise) login. This error shows up in those specs.
Controller specs run just fine. I see this warning in request specs concerning css, js, images etc.
I do have the dashboard.js
in the asset pipeline. And there is an app/assets/javascripts/dashboard.coffee
file.
# config/initializers/assets.rb
Rails.application.config.assets.precompile += %w[
sites.js
sites.css
admin.js
admin.css
header.js
dashboard.js
dashboard.css
setup.js
setup.css
]
Here is the warning I see.
DEPRECATION WARNING: The asset "header.js" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.
(called from _app_views_layouts_dashboard_html_slim__2366450786595837886_80483400 at /home/ziyan/Work/Brevica/churchfoyer/app/views/layouts/dashboard.html.slim:17)
DEPRECATION WARNING: The asset "dashboard.js" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.
(called from _app_views_layouts_dashboard_html_slim__2366450786595837886_80483400 at /home/ziyan/Work/Brevica/churchfoyer/app/views/layouts/dashboard.html.slim:18)
DEPRECATION WARNING: The asset "dashboard.css" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.
(called from _app_views_layouts_dashboard_html_slim__2366450786595837886_80483400 at /home/ziyan/Work/Brevica/churchfoyer/app/views/layouts/dashboard.html.slim:19)
DEPRECATION WARNING: The asset "logos/logo-white.png" is not present in the asset pipeline.Falling back to an asset that may be in the public folder.
This behavior is deprecated and will be removed.
To bypass the asset pipeline and preserve this behavior,
use the `skip_pipeline: true` option.
(called from _app_views_layouts_dashboard__sidebar_html_slim___2324799200884164274_84919380 at /home/ziyan/Work/Brevica/churchfoyer/app/views/layouts/dashboard/_sidebar.html.slim:3)
I appreciate any advice on how to resolve this warning.
What I think is that the asset pipeline is been bypassed for specs.
You need to add dashboard.js
in the assets.rb
file to know rails that it needs to be precompiled..
#/config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( dashboard.js )
Add this line, actually you just need to uncomment it and add the file name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With