The text in the book is certainly ambiguous, but there are at least two (possibly three) instances where, to me, Gandalf appears to touch the Ring.
1. "He [Frodo] unfastened it and handed it slowly to the wizard. It felt suddenly very heavy, as if either it or Frodo himself was in some way reluctant for Gandalf to touch it. Gandalf held it up. It looked to be made of pure and solid gold."
'It' could refer to the Ring or the chain. In the final sentence 'it' certainly refers to the Ring, which leads me to believe the same is true for the previous sentence.
2. "For a moment the wizard stood looking at the fire; then he stooped and removed the ring to the hearth with the tongs, and at once picked it up. Frodo gasped."
'It' could refer to the tongs, but then we would expect Tolkien to use 'them', since tongs is plural.
1. "He [Frodo] unfastened it and handed it slowly to the wizard. It felt suddenly very heavy, as if either it or Frodo himself was in some way reluctant for Gandalf to touch it. Gandalf held it up. It looked to be made of pure and solid gold."
'It' could refer to the Ring or the chain. In the final sentence 'it' certainly refers to the Ring, which leads me to believe the same is true for the previous sentence.
2. "For a moment the wizard stood looking at the fire; then he stooped and removed the ring to the hearth with the tongs, and at once picked it up. Frodo gasped."
'It' could refer to the tongs, but then we would expect Tolkien to use 'them', since tongs is plural.