speed up selecting gems to pristine by selecting them in ruby, update #2258