Ok so, I\'m getting this error when I try to use the asset pipeline. I don\'t understand what\'s causing it.
Sprockets::Helpers::RailsHelper::AssetPaths::Ass
I have been wrestling with the problem myself, although with config.assets.compile = false
set, as I suspect the example above was with the flag set to true
.
Cannot configure assets via pipeline on local production rails 3.1.3 server
My observations came down to it being a Sprockets 2.0.3 bug, as UberNeet suggested towards. The workaround was to either remove the period from the asset name, or include it as part of a manifest, rather than link to it directly.
The bug report for this is here: https://github.com/rails/rails/issues/3398
Looking at your issue above, and tallying it with my experience from the last two days, I suspect there is an associated issue with asset naming when config.assets.compile = true
is set. This issue probably stems from the asset naming - your manifest has the jquery.autocomplete library percompiled as:
jquery-5550a245a55b28927b5552cac182e612.autocomplete.js
But when you precompile these assets via rake using rake assets:precompile
, I believe they are actually compiled to:
jquery.autocomplete-5550a245a55b28927b5552cac182e612.js
It is probably this discrepancy that is causing the issue you mentioned. Might be worth raising another github issue for this too, although the workarounds are listed above, and I understand that Rails 3.2 will be using Sprockets 2.1.0, which may contain the fix for this issue already.
Be shure that it isn't required before in application.js for example.
Add the .js
to
javascript_include_tag 'jquery.autocomplete.js'
Seems like there is an missing functionality. When the filename has a period '.' in the name, the .js
extension will not get added when looking into the digest.
I did some debugging to Sprockets::Helpers::RailsHelper
and it seems like digest_for
methods gets the logical path without the .js.