Fix gem installation issues