He was born on Hillhead Farm near Mauchline in Ayrshire on 28 November 1867. He was the son of Cuthbert Gemmill and his wife Jeanie Leiper. He attended the local primary school in Mauchline[when?] and then Kilmarnock Academy. He studied Medicine at Glasgow University graduating MB ChB in 1894 and received his doctorate (MD) in 1900.
In the First World War he was conscripted as part of the 1916 Medical Recruitment Scheme as a lieutenant in the Royal Army Medical Corps. Despite an initial reluctance he rose to the rank of Major. At the point of recruitment he lived at 12 Ann Street in Hillhead, Glasgow. In 1919 he moved to Dundee having been appointed Professor of Natural History at University College, Dundee.
In 1923 he was elected a Fellow of the Royal Society of Edinburgh. His proposers were James Hartley Ashworth, James Cossar Ewart, John Stephenson, and James Ritchie. He was elected a Fellow of the Royal Society of London in the following year.
Gemmill's body was washed up several hundred metres downstream of the Tay Rail Bridge on 10 February 1926. He appeared to have committed suicide following a period of depression. He was buried in the Western Cemetery, Dundee on 13 February. He was unmarried and had no family.
- Turbellalia of the Scottish National Antarctic Expedition (1907)
- The Teratology of Fishes (1901, reprinted 1912)
- Natural History in the Poetry of Robert Burns (1928)
- "Gemmill, James Fairlie".
- "IN MEMORIAM: Thomas Walmsley, M.D., F.R.S.E., 1889-1951". J Anat. 86 (2): 226–8. 1952. PMC 1273773. PMID 14946074.
- Biographical Index of Former Fellows of the Royal Society of Edinburgh 1783–2002 (PDF). The Royal Society of Edinburgh. July 2006. ISBN 0-902-198-84-X.