By the mid-23rd century, synthesizing technology had become sophisticated enough that rubies could be easily created in large quantities whenever needed, greatly reducing their value. Standard technology aboard the USS Enterprise was capable of performing this process.
In 2267, an alien named Korob created a plateful of precious stones, including rubies, diamonds and sapphires, in an ill-conceived attempt to bribe Kirk, Spock, and McCoy into leaving Pyris VII and abandoning two Enterprise crewmen. An error led Korob to believe that the stones were still valued. (TOS: "Catspaw")
In the holosuite adventure Julian Bashir, Secret Agent, Bashir, posing as geologist Patrick Merriweather, had his knowledge of gemstones tested by Dr. Noah introducing him to a statue encrusted with rubies, tourmaline, sapphires and topaz. Merriweather identified the stones as "a most striking collection," and surmised that based on the high chromium content of the rubies, they must have originated from the hydrothermal deposits of the Tibetan plateau region. (DS9: "Our Man Bashir")