2012-02-03 27 views
3

我的應用程序是使用Ruby 1.8.7和Rails 2.3.11開發的。ActiveSupport :: Deprecation.silenced = true不適用於我?

我得到很多的棄用警告的同時運行「耙規範」

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 

我曾嘗試加入

ActiveSupport::Deprecation.silenced = true 
#in config/environments/test.rb 

不過還是我收到warnings.How我可以禁用它?

謝謝。

回答

3

在下一個主要版本中看起來像是config.activesupport.deprecation = :silence。請參閱https://github.com/rails/rails/pull/5986

請注意,您可以添加

ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:silence] = Proc.new { |message, callstack| } 

到您的應用程序現在爲@carlosantoniodasilva提到在評論中間,以獲得:silence行爲。

出棧,雖然,吃你的椰菜的答案將是改變了在config/application.rb您的通話config.load_paths和其他地方config.autoload_paths作爲警告,建議修復廢棄警告。 Mwah mwah關於長期忽略警告的建議等。

相關問題