Restore hooks PATH before calling ruby.

For https://github.com/gitlabhq/gitlabhq/pull/8131