Could not find where obsolete RAILS_ROOT is used

When I load rails ( rails s ), the first line displayed in the terminal is as follows:

 DEPRECATION WARNING: RAILS_ROOT is deprecated. Please use ::Rails.root.to_s. (called from /Users/x/Sites/x/config/application.rb:7) 

I was unable to isolate where this is used.

Line 7 mentioned above:

 Bundler.require(:default, Rails.env) if defined?(Bundler) 

Does anyone have any suggestions?

+7
source share
2 answers

One of your gems uses RAILS_ROOT in its initialization code.

From the directory of your application, try: grep -R RAILS_ROOT .

(If you use RVM, the package directory will be in ~/.rvm/gems , otherwise it could be .bundle in the main directory of the application.)

+9
source

You can find the root of the problem, as Paul said. But you can also try to raise gem versions in the Gemfile. The most recent reason for this is usually a bundle gem, and this (in rvm) is usually in a global gemset.

Try to release the version in global gemset with the command:

 gem update bundler 
0
source

All Articles