when using for example
inside a .html.erb file inside the asset pipeline, this works fine at runtime but not during pre compilation due to unavailability of the "params" variable in the below method when doing asset precompilation.
compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets])
ideally the check on the params is only performed when they are actually available (runtime configuration).
there is a fix, add this to your production.rb
I had this exact same issue. Changing params[:debug_assets] to params?[:debug_assets] would fix it.
I think that I fixed this issue and sent PR to 3-2-stable :-)
and please see also #5429.
Fix GH #5411. When precompiling, params method is undefined.
I'm closing this issue, because the above PR is merged. thanks