Gems are the premium currency of Clash of Clans, that is, you must pay real money for them, or get them organically with a lot of patience as you progress through the game through the dynamics that Supercell offers you to collect them.
Discover in this Mobailgamer post how to get free gems from Clash of Clans...
Ways to get gems in Clash of Clans
Gems are needed to buy builders and speed up building and upgrading of structures, and if you don't want to pay for them in the shop you should do the following:
To appear in the first places in periodic tournaments
To do this you must get a serious clan that allows you to achieve all the goals you want and get gems and other rewards.
Clear the weeds and stones of the village
This gives us few gems but there will always be garbage to start and therefore it is constant income
complete the achievements
Achievements are the main way to get gems, around 20 gems for each, but there is a maximum achievement called Sweet Victory that gives you 450 gems and so you can collect the third hut.