how do I go about tracking down DEPRECATION WARNING related to Bundler

I'm pretty new to Rails. I keep seeing these deprecation warnings when I start my app:

DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. 
(called from <top (required)> at D:/dev/AquaticKodiak/config/application.rb:12)
DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2. 
(called from <top (required)> at D:/dev/AquaticKodiak/config/application.rb:12)

OK, what's on line 12? This:

Bundler.require(:default, :assets, Rails.env)

Hmm, that's not really narrowing it down. This says to me that one of the gems that's related to my app is using a keyword that will disappear soon. I'd really like to figure out which one. All the gems in my gemfile are using the >= [version] syntax, except the ones that are coming from github. I suspect that the github stuff is causing this, but how do I find out which project it is? Pulling code and searching for the keyword looks like work -- is there an easier way?


The Rails deprecation warning is pretty unhelpful here. It has a complete callstack that could help you find the out of date gem, but is filtering the result to return the first non-framework point in the callstack, in this case application.rb.

To find the offending gem I would grab the full callstack at ActiveSupport::Deprecation.warn, which is defined at line 10 of activesupport/lib/active_support/deprecation/reporting.rb.

If you have Pry installed (recommended) then add a conditional binding at line 11 of reporting.rb:

binding.pry if message =~ /ref is deprecated/

Then inspect caller.

If you post a Gemfile I can take a look for you.

链接地址: http://www.djcxy.com/p/56062.html

上一篇: c ++多线程同步

下一篇: 我如何去跟踪与Bundler相关的DEPRECATION WARNING