Rubies and sapphires are corundum, which is the next hardest gem mineral to diamond. Only silicon, titanium, or tungsten carbide is as hard (aside from a few substances that I doubt would be likely to be encountered).
Emeralds are beryl, which has a relative hardness of 7.5 to 8. They might be damaged by hardened steel or a couple of other minerals.