Roby was the son of a solicitor and was born in Tamworth, and was educated at Bridgnorth Grammar School. He won a scholarship to St John's College, Cambridge in 1849. He graduated as a Bachelor of Arts in 1853, and was the "Senior Classic" or top classics student of that year. He was made a fellow of St John's College in the following year. He worked as a lecturer and private tutor in Cambridge from 1854 to 1861. He was, however, highly critical of the administration of the university. In particular he felt that the constituent colleges were prone to pursue policies in complete isolation from each other, leading to frequent conflicts. This he likened to the collision of "17 bodies in a confined space moving vagueley in the dark".
In 1860 he left Cambridge, becoming under master of the Upper School at the College of God's Gift, Dulwich. On 13 August 1861 he married Mary Ann Mathilda Ermen, the daughter of Peter Albert Ermen, a Dutch-born Manchester cotton spinner. Finding the teaching of Latin at Dulwich in need of reform, he wrote An Elementary Latin Grammar in 1862. He remained at Dulwich until 1865.
Roby was involved in reforming the governance of public and grammar schools. In December 1864 he was appointed secretary of the Schools Inquiry Commission, which examined some 800 institutions. He was the author of much of the final report of the commission, which led to the enactment of the Endowed Schools Act 1869. The 1869 Act established an Endowed Schools Commission of which Roby was the first secretary, serving in that office until 1872, when he became a commissioner. The commission was dissolved at the end of 1874. From 1866 to 1868 he was professor of jurisprudence at University College, London, lecturing on Roman Law. In 1877 he was made life governor and a member of the Council of Owens College, and a governor of Manchester Grammar School.
Between 1871 and 1874 Roby expanded his 1862 publication into a two volume Grammar of the Latin Language, from Plautus to Suetonius, described by Encyclopædia Britannica as "a storehouse of illustrative quotations from Latin literature". In 1884 he published Introduction to Justinian's Digest and Commentary, for which he was awarded the honorary degree of LL.D by the University of Edinburgh. This was followed in 1902 by Roman Private Law in the Time of Cicero and the Antonines.
With the ending of his work as a schools commissioner in 1874, Roby became a partner in his father in law's firm of Ermen and Engels, sewing cotton manufacturers of Patricroft near Manchester. Soon afterwards the firm changed its name to Ermen and Roby.