John M. Ruby was born around 1835 in Pennsylvania to Elizabeth Ruby. His father died sometime before 1850. He lived in Hampden, Pennsylvania, until the 1850s, when he moved to Albany, Missouri. By 1860, he was working as a lawyer, and he owned $2,500 of real estate and $200 of personal property. He enlisted in the Union army on November 11, 1862, and he mustered in as a sergeant in Company H of the 7th Kansas Cavalry on July 25, 1863. He mustered out on December 5, 1864. He returned to the Union army almost immediately, mustering into Company H of the 7th Kansas Cavalry on December 16, 1864. He mustered out again on September 29, 1865. He probably died in the late 1860s.