fixes #7186 - fixing rubocop to run properly

Also propagate the error code out to the rake task