One commentator (Ross) takes the bold view that since no rain had fallen before the Flood (Gen 2:5), there had been no rainbows before this. But this is quite a stretch; the text only says that, at some time before Adam was created and before there were any plants (itself relevant to say because Adam was to be a tiller of the soil), there had been no rain. In short, that text hardly establishes that there was no rain between Gen 2 and Gen 6 (for literally hundreds and hundreds of years). My view is that surely God did not create rainbows at this point; the laws of physics do not change, so we must not understand “I do set my bow in the cloud” in this way. After all, the rainbow need not have been created at that moment for God’s statement to be true. The point might just as well be stated this way: “Henceforth, whenever you see a rainbow, remember this promise.” Besides, God always knew this would happen; you might say the laws of physics were so arranged as to create rainbows, and it is now that he announces their purpose.