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 タスクを実行すると、config/initializers のスクリプトが実行されますか?
あなたのレーキタスクがに依存している場合にそれは行います:environment。
:environment
つまり、次のようにタスクを宣言します。
task :my_task => :environment do ... end
ほとんどそうです。タスクがに依存している場合、rakeは初期化子を含む完全なRails環境をロードします:environment。