install gem if necessary.