不错,可以去掉两点。
File.expand_path('../application.rb', __FILE__) File.expand_path('application.rb', __dir__)
https://bogdanvlviv.github.io/posts/ruby/with-__dir__-we-can-restore-order-in-the-universe.html
机智,我都是这样的:
Dir[File.expand_path('./utility/*.rb', File.dirname(__FILE__))].each {|file| require file }