Electron Acceleration and Gamma-Ray Emission from Blazars