Gems can be earned through achievements and daily missions, clearing obstacles, purchasing with real money, or special events. You can also convert unused gold into gems at the conversion rate in the game's shop.