How do I find the source of a Rails 3 "Deprecation Warning"?
I'm getting a deprecation warning from Rails 3 in development.log as follows:
DEPRECATION WARNING: Calling a meth开发者_开发技巧od in Rails::Application is deprecated, please call it directly in your application constant MyApp::Application. (called from ... config/environment.rb:5)
When I go to config/environment.rb, I get this:
MyApp::Application.initialize!
Presumably this line is not the problem. I found something similar here, which seems to require exchanging Rails.Application for MyApp::Application - but I already have the latter.
Is there any way to determine what is triggering this warning?
Sure thing - here is what config/environment.rb looks like:
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
MyApp::Application.initialize!
精彩评论