Controlled tribbles weren't developed until about 2270 in the original timeline, and even then they weren't entirely safe as they grew to massive sizes. Scotty has to feed the tribble at some point, but what could he possibly have fed it that wouldn't result in the usual problems with tribbles?