简体   繁体   English

不推荐使用Gem缓存

[英]Gem cache is deprecated

My setup: Rails 2.3.10, Ruby 1.8.7, Gem 1.6.2, Mac OS X 我的设置:Rails 2.3.10,Ruby 1.8.7,Gem 1.6.2,Mac OS X.

I generated a scaffold and got this warning 我生成了一个脚手架并得到了这个警告

/Library/Ruby/Gems/1.8/gems/rails-2.3.10/lib/rails_generator/lookup.rb:212:Warning: Gem::cache is deprecated and will be removed on or after August 2011.  Use Gem::source_index.
/Library/Ruby/Gems/1.8/gems/rails-2.3.10/lib/rails_generator/lookup.rb:234:Warning: Gem::cache is deprecated and will be removed on or after August 2011.  Use Gem::source_index.

I don't intend to change lookup.rb since it is a Rails generator file, so how can I fix this warning? 我不打算更改lookup.rb,因为它是一个Rails生成器文件,所以如何修复此警告?

Deprecation warnings show us what will be changed/removed in future versions of rails 弃用警告向我们展示了在未来版本的rails中将更改/删除的内容

I found out an article where it's shown how to switch this warnings off. 我发现了一篇文章 ,其中显示了如何关闭此警告。

For a one stop, general, solution do: 对于一站式,一般,解决方案做:

ActiveSupport::Deprecation.silenced = true

The article has a couple of finer grained solutions. 这篇文章有几个更细粒度的解决方案。

别担心,因为它是一个生成器文件,它将更新到这个日期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM