The difference between them is that script/runner
boots Rails whereas a Rake task doesn’t unless you tell it to by making the task depend on :environment
, like this:
task :some_useful_task => :environment do
# do some useful task
end
Since booting Rails is expensive, it might be worth skipping if you can avoid it.
Other than that, they are roughly equivalent. I use both, but lately I’ve used script/runner
executing a script separately more.