Fix rbenv gems helper

Fixes gem versions with words (beta, pre) in the version or with
multiple installed versions not being highlighted, and compatibility
with GNU sed (related to robbyrussell/oh-my-zsh#1579).
Merge pull request #1594 from jbhannah/rbenv-gems-fix

Fix rbenv gems helper