The phrase the end of the rainbow, and its variants, are used of something impossible to obtain or achieve.
The image is of an illusory quest for the treasure supposed to lie where the rainbow appears to touch the ground.
Mark Ritchie used the phrase the end of the rainbow of something that has been obtained in After-dinner speaking, about the growth in the after-dinner entertainment market, published in The Stage (London, England) of Thursday 9th August 2007:
People who would years ago have found a home in the variety theatre are finding the pot of gold at the end of the after-dinner rainbow.
Comedy duo Brahms and Liszt pull fees of £5,000 plus, due to the fact they are simply one of a kind.
The earliest occurrences of the phrase the end of the rainbow and variants that I have found are as follows, in chronological order:
1-: From On the Progress of the Moderns, in Knowledge, Refinement, and Virtue, an unsigned article published in The Theological Magazine, or Synopsis of Modern Religious Sentiment (New York: Printed by T. and J. Swords, for Cornelius Davis) for March and April 1796:
The philosopher’s sing-song “of the fogs and mists dispelling, and the dawnings of a bright and glorious day,” by dint of human sagacity alone, resembles the fruitless chace of the peasant’s boy after the glories of the rainbow’s end; or following the thread of labyrinths, which brings us to the place from whence we took our departure.
2-: From Virginia, An Opera, In Three Acts (London: Printed and published by J. Barker, 1800), by Mrs. F. Plowden:
Enter Lord Delaware with solemn step.
Dela. Vain’s the philosophy of man; a mud-born meteor that leads the conceited theorist to a confused and ever distant view of fancied bliss. Thus have I seen a churlish lad beguiled into precipitate avidity to catch the rainbow’s end; less sottish he, than fond pretenders to philosophy, who on the occasion for its aid, crouch vanquished and aghast at the resistless ray of truth.
3-: From Memoir of James Boswell, Esq. 1, by ‘H.’, published in The Monthly Magazine; Or, British Register (London, England) of July 1803:
In an attempt to exhibit a summary of the qualities of Boswell’s character, I should mark him as a genius of the second class. He had vivacity, but wanted vigour of imagination; his judgement was more quick than just; an unlucky passion for celebrity made him run continually in quest of it, as the peasant-boy runs to find the treasure at the end of the rainbow, instead of earning it by that energetic diligence in business, or that toil of solitary study, which are necessary to be paid as the prices of great and lasting reputation.
1 The Scottish biographer and diarist James Boswell (1740-1795) is best known for the biography of the English lexicographer Samuel Johnson (1709-1784).
4-: From The Highlands and Western Isles of Scotland, containing descriptions of their scenery and antiquities, with an account of the political history and ancient manners, and of the origin, language, agriculture, economy, music, present condition of the people, &c. &c. &c. (London: Longman, Hurst, Rees, Orme, Brown, and Green, 1824), by John MacCulloch (1773-1835):
Such is happiness; always at the end of the rainbow; or like a pig with his tail greased, at a country fair; it may be apprehended, but still it escapes “sceleratus, vincula, Proteus.” 2
2 This refers to the following from Book II: Satire 3, by the Roman poet Horace (Quintus Horatius Flaccus – 65-8 BC)—Proteus is a debtor from whom it is impossible to collect:
Effugiet tamen hæc sceleratus vincula Proteus.
Nevertheless, that rascal Proteus escapes all these chains.
5-: From The Bow in the Cloud, in Tales and illustrations, chiefly intended for young persons (Dublin: Published by the Religious Tract and Book Society for Ireland, 1829), by the British author Charlotte Elizabeth Tonna (1790-1846):
Presently, the sun shone out beautifully; and the rain ceased to patter upon the leaves. Our two little boys left their shelter, and returned towards the road. “Oh, look brother!” cried John, “what a lovely rainbow! It seems so large and bright, and quite near us.”
A man who was passing them on horseback heard the remark, and said, “Aye, ’tis very near; and if you run to the place where the end of it rests, you will find a fine pot of money.”
“Which end, Sir,” said Henry: but the man was out of hearing, having spoken a falsehood for the sake of a silly jest. This is very wicked: it is also very cruel to deceive the young and ignorant; for when they find themselves imposed on by bad people, they sometimes are afraid to believe what is told them by good ones.
6-: From The Sin of slavery, and its remedy; containing some reflections on the moral influence of African colonization (New York: Printed for the author, 1833), by the U.S. mathematician and abolitionist Elizur Wright Jr. (1804-1885):
I come now to the Society’s 3 last resort—its citadel when hotly pursued by northern philanthropists. It is almost certain that the non-slave-holding friends of the Society are, to a man, painfully conscious of a perpetual obscurity, like a Newfoundland fog, hanging around the point of the Society’s tendency to remove slavery. Not even the figures, that are so often pompously paraded to show what may be done, can clear it away. Both the how, and the when, are beyond the reach of figures. The consummation so devoutly to be wished for, is a semper fugiens, to the Colonization Society, more evanescent than the silver cups at the end of the rainbow, and which leaves the silly arithmetician out of breath, and bewildered in his own pursuit. This, evidently, is not the aspect of the Society on which its friends like best to dwell.
3 This refers to the American Colonization Society (ACS) was formed in 1817 to send free African-Americans to Africa as an alternative to emancipation in the United States.
7-: From Agricultural and Commercial Herald, in The Bury & Norwich Post, & East Anglian; Or, Suffolk, Norfolk, Essex, Cambridge, and Ely Intelligencer (Bury St Edmunds, Suffolk, England) of Wednesday 3rd June 1835:
We shall say nothing about the vaunted benefit to Scotch farmers of one pound paper currency in that part of the kingdom, and which has been referred to with an eye of envy in a recent petition from Norfolk, because we could add nothing to the force and conclusiveness of the reasoning which our editor employed to expose its fallacy a fortnight back; nor should we have dwelt so long upon the dry and complex subject which has occupied the present and preceding article, if it had not appeared to us that some of our own farmers were running themselves out of breath to catch the end of a rainbow—like the boy who was told he would find a money-bag under the spot where it touched the earth. Many of us seem to fancy that by forcing a large currency upon the country we shall convert it into another El Dorado, where gold is as common as dust, and the common dust is gold dust. Be it so: we could neither it, nor drink it, nor cloathe ourselves with it. Leaf-gold would be a very flimsy material for our habiliments, and the aurum potabile but an ordinary article to quench our thirst with.
8-: From the review of The Elements of Moral Science (New York: Cooke & Co., 1835), by Francis Wayland—review by Elizur Wright, Jr., published in The Quarterly Anti-slavery Magazine (New York: Published by the American Anti-Slavery Society) of January 1836:
Never did men better exemplify the apostolic description, “ever learning and never able to come to the knowledge of the truth,” than the professed disciples of “consequences.” With them nothing is morally certain. They can by no possibility conceive of such a thing, as, “doing right, regardless of consequences,” for to them “right” is the golden spoon at the end of the rainbow, which they may pursue over ditch and quagmire, and be as far from it as ever. Grown wise by experience, they do not expect to reach it—still it is at the end of the rainbow! At any given time in the lives of these sage moralists, if they be asked, Are you doing right? the reply must be, No we are watching consequences.
9-: From A Glossary of the provincialisms in use in the county of Sussex (Brighton: Printed, for private distribution, by W. Fleet, 1836), by William Durrant Cooper (1812-1875):
Crock, […] An earthern [sic] vessel […].
“Go to the end of the rainbow, and you’ll find a crock of money.”—Sussex Proverb.