无法找到已弃用的 RAILS_ROOT 的使用位置 [英] Unable to locate where deprecated RAILS_ROOT is used

查看:34
本文介绍了无法找到已弃用的 RAILS_ROOT 的使用位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加载 rails (rails s) 时,终端中显示的第一行是:

When I load rails (rails s) the first line that shows up in the terminal is:

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

我一直无法确定使用它的地方.

I have been unable to isolate where this is being used.

上面提到的第7行是:

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

有人有什么建议吗?

推荐答案

你的一个亮点是在其初始化代码中使用了 RAILS_ROOT.

One of your gems is using RAILS_ROOT in its initialization code.

从您的应用程序包目录中,尝试:grep -R RAILS_ROOT .

From your app's bundle directory, try: grep -R RAILS_ROOT .

(如果您使用的是 RVM,bundle 目录将在 ~/.rvm/gems 中;否则它可能在您的应用程序主目录中的 .bundle 中.)

(If you are using RVM, the bundle directory will be in ~/.rvm/gems; otherwise it may be .bundle within your app's main directory.)

这篇关于无法找到已弃用的 RAILS_ROOT 的使用位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆