Degassing of rhyolitic magma during ascent and emplacement