© 2016 The Authors Published by Oxford University Press on behalf of the Royal Astronomical Society.We combine dust, atomic (H i) and molecular (H2) hydrogen mass measurements for 176 galaxies in the Herschel Reference Survey to investigate the effect of environment on the gas-to-dust mass (Mgas/Mdust) ratio of nearby galaxies. We find that, at fixed stellar mass, the average Mgas/Mdust ratio varies by no more than a factor of ~2 when moving from field to cluster galaxies, with Virgo galaxies being slightly more dust rich (per unit of gas) than isolated systems. Remarkably, once the molecular and atomic hydrogen phases are investigated separately, we find that H i-deficient galaxies have at the same time lower MHI/Mdust ratio but higher MH2/ Mdust ratio than H i-normal systems. In other words, they are poorer in atomic but richer in molecular hydrogen if normalized to their dust content. By comparing our findings with the predictions of theoretical models, we show that the opposite behaviour observed in the MHI/Mdust and MH2/Mdust ratios is fully consistent with outside-in stripping of the interstellar medium (ISM), and is simply a consequence of the different distribution of dust, H i and H2 across the disc. Our results demonstrate that the small environmental variations in the total Mgas/Mdust ratio, as well as in the gas-phase metallicity, do not automatically imply that environmental mechanisms are not able to affect the dust and metal content of the ISM in galaxies.