A novel computer-aided diagnosis system of nuclear cataract via ranking is firstly proposed in this paper. The grade of nuclear cataract in a slit-lamp image is predicted based on its neighboring labeled images in a ranked images list, which is achieved using an optimal ranking function. A new ranking evaluation measure is proposed for learning the optimal ranking function via direct optimization. Our system has been tested by a large dataset composed of 1000 slit-lamp images from 1000 different cases. Both experimental results and comparison with several state-of-the-art methods indicate the superiority of our system.