I'm pretty sure the comic just shows Eggman finding the Phantom Ruby half-buried in sand next to his base. The implication might be that it was there before but it just became unearthed by the wind. IIRC, someone in this thread mentioned Ian saying that the reason the ruby in the comic looked like the prototype from Mania was that the artist wasn't shown that concept art. It we go by that, it wasn't supposed to be the one from Mania. Canon-wise, it probably should have looked like the original uncut ore on the left instead.