Born in 1842 in Ohio, Major General Ernst graduated from Harvard and West Point before entering the Army's Corps of Engineers. He worked as an engineer in the U.S. and Mexico before the war, and was a consultant on the building of the Panama Canal afterwards. During the war with Spain, his brigade formed part of General Wilson's expedition that was sent from Virginia to Puerto Rico. General Ernst's actions contributed significantly to the success of the 16th Pennsylvania Volunteer Infantry in the battle of Coamo. For his service in that fight, he was promoted to the rank of Major General.