Handle cases where _gem() returns False

This prevents a traceback when _gem() returns False due to a problem
running the gem command. Fixes #5886.
Merge pull request #5890 from terminalmage/issue5886

Handle cases where _gem() returns False