modified optmygem.sh in active*