An accurate and nondestructive prediction method of lime acidity was established based on near infrared (NIR) spectroscopy and ensemble learning strategy. Dual-band spectra were obtained nondestructively with a single scan using a desk-top Fourier transform spectrometer and a grating portable spectrometer. Spectral preprocessing methods were used to eliminate the interferences in the spectra. The quantification models of available acidity (pH and 10−pH) and total acidity (TA) were developed with the ensemble learning strategy compared with partial least squares (PLS) and variable selection methods. The results indicated that due to the high-energy light source, the models of the grating portable spectrometer were much better than those of the Fourier transform spectrometer. Short-wave NIR (SWNIR) was more suitable for quantitative analysis of available acidity, while long-wave NIR (LWNIR) was more effective for quantitative analysis of TA. Besides, the models of available acidity were ahead of those of TA. Compared with PLS and variables selection methods, the ensemble learning strategy can produce models with higher prediction accuracy and better robustness. In the optimized models, the correlation coefficients of pH, 10−pH and TA for the prediction set were 0.84, 0.82 and 0.66, respectively. The experiment results show that accurate and nondestructive prediction of lime acidity can be achieved with the grating portable NIR spectrometer and ensemble learning strategy.