加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 不推荐使用Gem缓存

发布时间:2020-12-17 02:28:41 所属栏目:百科 来源:网络整理
导读:我的设置:Rails 2.3.10,Ruby 1.8.7,Gem 1.6.2,Mac OS X. 我生成了一个脚手架并得到了这个警告 /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 20
我的设置:Rails 2.3.10,Ruby 1.8.7,Gem 1.6.2,Mac OS X.

我生成了一个脚手架并得到了这个警告

/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.

我不打算更改lookup.rb,因为它是一个Rails生成器文件,所以如何修复此警告?

解决方法

弃用警告向我们展示了在未来版本的rails中将更改/删除的内容

我发现了一个article,它显示了如何关闭此警告.

对于一站式,一般,解决方案做:

ActiveSupport::Deprecation.silenced = true

这篇文章有几个更细粒度的解决方案.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读