Optical networks-on-chip (NoC) based on silicon photonics has been proposed as an emerging on-chip communication infrastructure of chip multiprocessors. However, due to thermal sensitivity of optical devices under on-chip temperature variations, significant thermal-induced optical power loss would offset the benefit of optical NoCs in power efficiency. In this work, we propose a thermal-aware adaptive routing scheme based on ant colony optimization (ACO) to alleviate the thermal issue. The proposed ACO-based routing scheme applies the ACO method to formulate and optimize the routing decisions with the objective of reducing optical power loss under temperature variations. The traditional implementation of the ACO-based routing scheme requires a table in each node to keep and update pheromone, and the table size increases linearly with the number of nodes in the network. To avoid the table overhead, we further propose an approximate ACO-based routing (AACO) scheme based on linear regression. A case study on an <inline-formula> <tex-math notation="LaTeX">$8\times 8$ </tex-math></inline-formula> mesh-based optical NoC under a series of synthetic traffic patterns and real applications shows that the proposed routing schemes are able to select near-optimal paths under varying on-chip temperature variations. We further verify the scalability of the proposed routing schemes in a larger network.