LoginSignup
3
3

More than 5 years have passed since last update.

Railsの自動ロードのパスの調べ方

Posted at

どこをロードしていてどこがされていないのかよくわからなくなるのでメモ
pryをインスト―ル後にrails cを実行し、下記を実行するとだいたいわかるはず

pry(main)> ActiveSupport::Dependencies.autoload_paths
# これで色々出力される(デフォルトのロードパス?)
=> ["/Users/USERNAME/rails_path/app/assets/*",
 ...]
pry(main)> YOUR_APPLICATION_NAME::Application.config.autoload_paths # YOUR_APPLICATION_NAMEはconfig/application.rbに記載してあるはずなので見てみよう
# 何も設定していなかったら空
=> []
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3