At least part of the objective was for Frodo to be able to leave secretly, so as to not draw too much attention to himself. This is confirmed by the opening of the chapter Three is Company:
'You ought to go quietly, and you ought to go soon,' said Gandalf. Two or three weeks had passed, and still Frodo made no sign of getting ready to go.
'I know. But it is difficult to do both,' he objected. If I just vanish like Bilbo, the tale will be all over the Shire in no time.'
'Of course you mustn't vanish!' said Gandalf. 'That wouldn't do at all! I said soon, not instantly. If you can think of any way of slipping out of the Shire without its being generally known, it will be worth a little delay. But you must not delay too long.'
Following this exchange, Frodo and Gandalf had resolved that Frodo's departure date was going to be on his (and Bilbo's) birthday, which Frodo duly followed through on; but then - in Gandalf's note to Frodo to be delivered via Butterbur - we read (in the chapter Strider):
Bad news has reached me here. I must go off at once. You had better leave Bag End soon, and get out of the Shire before the end of July at latest.
So obviously something had changed, but what? The answer is given in Gandalf's discussion of his delay at The Council of Elrond:
At the end of June I was in the Shire ... I came upon a traveller sitting on a bank beside the road with his grazing horse beside him. It was Radagast the Brown ...
"I have an urgent errand," he said. "My news is evil." Then he looked about him, as if the hedges might have ears. "Nazgûl," he whispered. "The Nine are abroad again. They have crossed the River secretly and are moving westward. They have taken the guise of riders in black."
Further on, Gandalf confirms that this was what had prompted his letter to Frodo which he had left with Butterbur (and which Butterbur had failed to deliver).
Putting it all together we can then say that:
- Gandalf had fully recognised the danger at the time he had discovered that Frodo's Ring was the One, but:
- At the time it was felt important that Frodo's departure should be kept secret so as to not draw attention, and:
- Gandalf was not aware at the time that the Nazgûl were abroad and seeking for the Shire, and:
- As soon as he became aware of it, he modified the plan and attempted to advise Frodo to leave sooner.
I've emphasised what seems to me the most important point here; for sure leaving earlier would have avoided trouble, but since Gandalf didn't know that the Nazgûl were about, he had no reason to suspect that there would have been any such trouble.