Thanks for the tips and I'll try it! I used spear infantry, but I have to play another civ than Ptolemies like I did the last time!
I prioritized rams before, and built two caserns to build infantry on two sides of my territory, but it wasn't enough. Furthermore, I'll try with Britons, Gauls or Maurya, or other civs which have faster spearmen.