How to list all autoload paths in Rails

后端 未结 3 2112
轮回少年
轮回少年 2021-02-04 10:05

How do you list all of the autoload paths in Rails?

In Rails console when I do this, it only lists the custom paths added to the config:

$ rails c
Loading          


        
3条回答
  •  半阙折子戏
    2021-02-04 11:07

    You can access all the autoload paths through ActiveSupport::Dependencies.autoload_paths

    Invoke it from console or run rails r 'puts ActiveSupport::Dependencies.autoload_paths' from command line.

    More info here (For Rails 4, but it applies to Rails 3 as well): http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths

提交回复
热议问题