Rake docs say invoke will only complete the task if necessary. The following was extracted from another SO and could help clarify:
Rake :: Task ["build"]. execute always executes a task, but does not execute its dependencies
Rake :: Task ["build"]. invoke executes dependencies, but only performs this task if it has not already been called
Rake :: Task ["build"]. reenable first resets the task already in the inv_invoked state, allowing it to then complete the task again, dependencies and all.
source share