add gem check and install function