The d3 ions in trigonal crystal fields are considered. On the basis of the expansion of the electron wavefunctions under pressure, the expressions for the parameters Dq, B, C, K, K' and zeta as functions of the linear compression ratio chi are derived, and the complete d3 energy matrix in trigonal field is constructed. With the P-chi dependence, by diagonalization of this matrix to fit only the experimental data of the red shifts of ruby R1 line under quasihydrostatic pressure, the values of three parameters for the pressure shift (S0, D1 and t) are determined. Then, the values of Dq, B, C, K, K' and zeta at various pressures are evaluated, and the pressure shifts of the entire energy spectrum of ruby are theoretically calculated uniformly by diagonalization of the complete d3 matrix. The contributions of changes of Dq, B, C, K, K' and zeta to the R1 and R2 red shifts and the pressure-induced change in the R1-R2 splitting are obtained. The calculated results of the pressure shifts are in good agreement with all the experimental data of the R-, R'- and B-line groups and U and Y bands. A discussion is given and conclusions drawn.