Fix rbenv gems helper

Fixes gem versions with text (beta, rc) or multiple gem versions
not being highlighted, and incompatibility with GNU sed (related
to robbyrussell/oh-my-zsh#1579).