For ad hoc Rails tasks we have a few implementation alternatives, chief among which would seem to be:
script/runner some_useful_thing
and:
rake some:other_useful_thing
Which option should I prefer? If there’s a clear favourite then when, if ever, should I consider using the other? If never, then why would you suppose it’s still present in the framework without deprecation warnings?
The difference between them is that
script/runnerboots Rails whereas a Rake task doesn’t unless you tell it to by making the task depend on:environment, like this: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/runnerexecuting a script separately more.