3

My App was developed in Rails 2.3.11 and Ruby 1.8.7p352.

When I try to run 'rake spec' lot of deprecation warning is displayed in console.

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)

How can I disable deprecation logging in rails 2.3.11?

Soundar Rathinasamy
  • 6,658
  • 6
  • 29
  • 47
  • I asked a similar question here: http://stackoverflow.com/questions/5591509/suppress-ruby-warnings-when-running-specs – Jey Balachandran Feb 11 '12 at 23:25
  • 2
    yeah, you can do that, or just find `load_paths` replace `autoload_paths` and you're done. Then a) your errors are gone, b) you're -1 deprecation from rails 3. – TomDunning Feb 17 '12 at 14:44
  • See answer to http://stackoverflow.com/questions/9126331/activesupportdeprecation-silenced-true-does-not-works-for-me – Ryan McCuaig Apr 30 '12 at 16:03
  • Hi can you mark the right answer or post the answer that worked for you, it might help others – Ross Oct 17 '12 at 10:30
  • @Ross Marked answer in http://stackoverflow.com/questions/9126331/activesupportdeprecation-silenced-true-does-not-works-for-me – Soundar Rathinasamy Oct 17 '12 at 10:41

2 Answers2

3

In Rails 2.3.9 config.load_paths and .load_once_paths has been renamed to config.autoload_paths and .autoload_once_paths. Some plugins (like Fckeditor) may still use the old version. Search for load_paths and replace it by autoload_paths, then the error should disappear.

0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140
2

To turn off depreciation warnings, simply set

ActiveSupport::Deprecation.silenced = true

You can also turn off warnings for specific code, with

ActiveSupport::Deprecation.silence do
  your_code_here 
end
iHiD
  • 2,450
  • 20
  • 32
  • 1
    This is not working in the mentioned Rails version. If anybody looks for answer please visit http://stackoverflow.com/questions/9126331/activesupportdeprecation-silenced-true-does-not-works-for-me – Soundar Rathinasamy Oct 17 '12 at 10:39