Nope, because code loader (Zeitwerk) isn't setup on Rails commands, it's only load `config/boot.rb` (see https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/bin/rails.tt#L2 ), and the `boot.rb` only load gems and Bootsnap (see https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/config/boot.rb.tt ),
BTW, me +1 for this proposal, here's my hacking https://github.com/jasl/cybros_core/blob/master/bin/rails 在 2020年1月15日星期三 UTC+8上午5:35:25，Xavier Noria写道： > > Hey Prem! The lib directory is indeed in $LOAD_PATH, maybe your app does > not have it for some reason? > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/6f60e042-9557-4259-a259-56308a038c1f%40googlegroups.com.