When trying to update my rails 3.1.0.rc4 app to rc6, I must have messed something up because my assets (JS and CSS files) stopped rendering. I tried to revert to rc4, but was still having this problem. So I transferred all my files over to a new 3.1.0.rc6 app and everything appears to work fine, but I get the following messages:
Sprockets::Environment#static_root is deprecated
Sprockets::Environment#path is deprecated
followed by a long list of files - I can attach the extended msg if needed. I'm guessing I inadvertently fooled around with the sprockets configuration and that's what's been messing up my app from the beginning. How do I de-deprecate/re-?configure sprockets I guess is my question?
I've tried some different sprockets gem versions, but nothing has worked yet.
Thanks.
Check this for the deprecation warnings https://github.com/rails/rails/issues/2598
So these warning will be removed and don't affect functioning of your app.
As everyone said, this is a harmless deprecation error. Like some, I perhaps irrationally find the messages in my logs and test sessions irritating. This github issue suggests a quick and effective work around:
https://github.com/sstephenson/sprockets/issues/161
Sprockets 2.0.0.beta.14 is the culprit and putting this in your gem file clears the errors:
gem 'sprockets', '2.0.0.beta.13'
Just don't forget to check back for an official release or follow the original issue linked to by Nico for news of the real fix. Then you can free this version specific dependency and upgrade without these messages.
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