Two ways. Become a Star Captain and they are available directly, or keep playing and they will occasionally drop after you defeat monsters or complete quests.
The random route is unreliable, which is why most players go for the Star Captain status instead. If you have already paid for that, the gems stop being a problem entirely.
If you are free-to-play, the drop route works but expect to grind. The gems appear often enough over a long session, just not on demand.