This question already has an answer here:
An alien species I have been working out recently lives on a high gravity planet. Because of this, they need to be able to gain muscles fast. Of course this is given since birth, but they need other supplements. So I figured that because some rocks have certain minerals in them that help with muscle growth, that they'd be able to eat and digest them
The path of evolution for this would be that they started off drinking mineral rich water on the planet, and as time went on, their stomachs would be better at digesting and using the minerals. So over time, their teeth strengthen somehow (I am working that out) and they are successfully able to chow down on some rocks.