Ramp compression experiments characterize high-pressure states of matter at temperatures well below those present in shock compression. However, because temperature is typically not directly measured during ramp compression, it is uncertain how much heating occurs under these shock-free conditions. Here, we performed a series of ab initio simulations on carbon in order to match the density-stress measurements of Smith et al. [Smith, et al., Nature 511, 330 (2014)]. We considered isotropically as well as uniaxially compressed solid carbon in the diamond and BC8 phases, with and without defects, as well as liquid carbon. Our idealized model ascribes heating during ramp compression to an initially uniaxially compressed cell transforming isochorically into an isotropically (hydrostatic equivalent) compressed state having lower internal energy, hence higher temperature so as to conserve energy. Multiple such heating events can occur during a single ramp experiment, leading to higher temperatures than with isentropic compression. Comparison with experiments shows that heating alone does not explain the equation of state measurements on diamond, instead implying that a significant uniaxial stress component remains present at high compression. The temperature predictions of our ramp compression model remain to be verified with future laboratory measurements.