Ruby 如何查看 DEPRECATION WARNING 是哪个 gem 的?

linjunpop · February 17, 2012 · Last by bindiry replied at February 18, 2012 · 3122 hits

如何查看 DEPRECATION WARNING 是哪个 gem 的?

我现在也是有这提示,但找不出是哪个 gem 出的问题,可能最简单的方法还是挨个 gem 注释掉测试。。。

#1 楼 @bindiry 搞定了

直接改 /Users/linjunpop/.rvm/gems/ruby-1.9.3-p0-falcon@fo-web/gems/activesupport-3.2.1/lib/active_support/deprecation/reporting.rb

13 行左右,找到这段, ap callstack 就知道了

def warn(message = nil, callstack = caller)
  return if silenced
  deprecation_message(callstack, message).tap do |m|
    behavior.each { |b| b.call(m, callstack) }
  end
end

不知道有没有更简单的办法。

#2 楼 @linjunpop 直接改去提示去掉啊?

btw: 严重怀疑楼主和我的名字只差一个字...

You need to Sign in before reply, if you don't have an account, please Sign up first.