Lock gem environment.