开发者

Rails 3.1.0 assets folder not rendering: Sprockets::Environment#static_root is deprecated

开发者 https://www.devze.com 2023-03-29 16:51 出处:网络
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) stop开发者_开发百科ped rendering. I tried to revert to rc4, but was still havi

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) stop开发者_开发百科ped 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消