In 1767 Rui was appointed Commandant governor of Illinois, arriving in New Orleans the same year. He was official commandant of Missouri county.[2] On January 7, 1767, Louisiana governor Antonio de Ulloa, gave secret instructions to Rui, about the construction of two forts at the confluence of the Missouri and Mississippi Rivers.[3] Spanish troops and workmen arrived with orders to build the forts.[4] Fort Don Carlos el Senor Principe de Asturias was built on the south bank of the Missouri.[2] Rui occupied the fort on the Missouri until August 4, 1767[3] or in 1769.[2] (according to the sources).
Rui left office of Lieutenant governor of Illinois in 1768 and was replaced by Colonel Pedro Piernas.