Make `rake doc:guides` works again.  Fix #10384.
Minor code duplication removed
Abort a rake task when missing db/structure.sql like `db:schema:load` task.