Determination of the gas-to-dust ratio in nearby dense clouds using X-ray absorption measurements