&tag(Rails4/バッチ処理); *目次 [#x544de02] #contents *関連ページ [#f74dc668] *参考情報 [#d9f833a9] *基本 [#t3affe26] -lib/tasksの下にファイルを作成し、バッチ処理的な事を行わせる。 *作成方法 [#c996ef77] **config/application.rbの設定 [#mf1e95d3] -autoload_pathsを設定しておく config.autoload_paths += %W(#{config.root}/lib) # 追加 -lib/tasks/hello_task.rbを作成する #pre{{ class Tasks::HelloTask def self.execute print "Hello World!! env=#{Rails.env}\n" end end }} -実行する bundle exec rails runner "Tasks::HelloTask.execute"