我的应用程序是在Rails 2.3.11和Ruby 1.8.7p352中开发的。
当我尝试运行' rake spec'很多弃用警告显示在控制台中。
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/manager.rb:36)
如何在rails 2.3.11中禁用弃用日志记录?
答案 0 :(得分:3)
在Rails 2.3.9中,config.load_paths和.load_once_paths已重命名为config.autoload_paths和.autoload_once_paths。一些插件(如Fckeditor)可能仍然使用旧版本。搜索load_paths
并将其替换为autoload_paths
,然后错误就会消失。
答案 1 :(得分:2)
要关闭折旧警告,只需设置
即可ActiveSupport::Deprecation.silenced = true
您还可以使用
关闭特定代码的警告ActiveSupport::Deprecation.silence do
your_code_here
end