For small volumes at the micrometer and nanometer level, classical continuum mechanics cannot be used to capture experimentally observed phenomena, such as size effects. Moreover, dissipation is much less pronounced than that in the case of macroscopic volume elements. To remedy the situation, generalized continuum mechanics theories should be used as an alternative to molecular dynamics simulations which do provide physical insight, but may not be suitable for engineering applications and the formulation of related boundary value problems. The present contribution is an example in this direction. An Euler–Bernoulli beam model is constructed to study the vibration of a nanobeam subjected to ramp-type heating. A generalized thermoelasticity theory with non-local deformation effects and dual-phase-lag (DPL) or time-delay thermal effects is used to address this problem. An analytical technique based on Laplace transform is employed. The inverse of Laplace transform is computed numerically using Fourier expansion techniques. The effects of nonlocality, DPLs, and the ramping-time parameter on the lateral vibration, the temperature, the displacement and the flexural moment of the nanobeam are discussed. The results are shown quantitatively in corresponding graphs.