Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有自己的课程,我想在我的 rake 任务中使用它们。将这些类的文件放在哪里?
如果这些类仅由 rake 任务使用,我会将它们保留在 中lib/,只需确保通过配置加载目录autoload_paths:
lib/
autoload_paths
# application.rb config.autoload_paths += %W(#{config.root}/lib)