I could not find Bilbo's strange reaction to the ring at Rivendell in the book.
After the feast in Rivendel, when Frodo first met Bilbo again after seventeen years of separation, and during their catching up on the comings and goings, Bilbo became curious about the ring.
'Have you got it here? he asked in a whisper. 'I can't help feeling curious, you know, after all I've heard. I should very much like just to peep at it again.'
'Yes I've got it,' answered Frodo, feeling a strange reluctance. 'It looks just the same as it ever did.'
'Well I should just like to see it for a moment,' said Bilbo.
...Slowly he drew it out. Bilbo put out his hand. But Frodo quickly drew back the Ring. To his distress and amazement he found that he was no longer looking at Bilbo; a shadow seemed to have fallen between them, and through it he found himself eyeing a little wrinkled creature with a hungry face and bony groping hands. He felt a desire to strike him.
The music and singing round them seemed to falter, and a silence fell. Bilbo looked quickly at Frodo's face and passed his hand across his eyes. 'I understand now, he said. 'Put it away! I am sorry: sorry you have come in for this burden: sorry about everything. Don't adventures ever end? I suppose not. Someone else always has to carry on the story. Well, it can't be helped. I wonder if it's any good trying to finish my book? But don't let's worry about it now--let's have some real News! Tell me all about the Shire!'
Book 2, Chapter 1 entitled 'Many Meetings,' a couple pages prior to Bilbo's poem, Eärendil was a mariner.