The incident was reported in the 4100 block of Shafter Avenue at 10:26 p.m.
The victim was approached from behind and pistol-whipped by two juvenile suspects, police said.
When the gun discharged, the suspects fled. No one was hit by the bullet.
The victim suffered minor injuries in the robbery attempt but declined medical attention, police said.