Theory for the Solubility of Gases in Polymers