It does not directly mention an artificial food generator, but I think it is close and is is from the father of science-fiction: Jule Verne together with his son Michel wrote in "In the Twenty-Ninth Century:
The Day of an American Journalist in 2889"
(Au XXIXme Siecle:
La Journée d’un Journaliste Américain en 2889, first appeared 1889, but later modified and published again in 1891) about two things that come close to a food generator.
The story is about Francis Bennet, the owner of the "World Herald" (formerly "New York Herald") and a normal day in his life.
The Vernes actually anticipate quite a lot of developments and technologies.
You can find the full text here .
The first thing about food production that he mentions is not really clear to me.
It seems more like a distribution system for pre-cooked food, but might also be a replicator: Like everybody else in easy circumstances nowadays, Francis Bennett, having abandoned domestic cooking, is one of the subscribers to the Society for Supplying Food to the Home, which distributes dishes of a thousand types through a network of pneumatic tubes.
This system is expensive, no doubt, but the cooking is better, and it has the advantage that it has suppressed that hair-raising race, the cooks of both sexes.
Later Bennet is approached by inventors and owners of start up companies, requesting his opinion and funding.
One of these inventors found a way to transform all kinds of matters from one into another and even claims that creation of humans is possible: 'Sir,' he began, 'though the number of elements used to be estimated at seventy-five, it has now been reduced to three, as no doubt you are aware?' '
Perfectly,' Francis Bennett replied.
'
Well, sir, I'm on the point of reducing the three to one.
If I don't run out of money I'll have succeeded in three weeks.' '
And then?' '
Then, sir, I shall really have discovered the absolute.' 'And the results of that discovery?'
'
It will be to make the creation of all forms of matter easy - stone, wood, metal, fibrin . . .'
'Are you saying you're going to be able to construct a human being?' '
Completely ...
The only thing missing will be the soul!'
'
Only that!'
was the ironical reply of Francis Bennett, who however assigned the young fellow to the scientific editorial department of his journal.
He does not mention food, but all kinds of matter, hence describes a replicator.
If the guy gets his funding from Bennet and he gets it to work, he might be building the first replicator of science-fiction history.
scifi.stackexchange.com/users/2037/Till B
Off the top of my head (and therefore probably not the earliest) Some of Niven's stories (e.g. At the Core ) from the 70's have "autochefs" that seem to synthesize food on demand.
Note that these are definitively not general purpose replicators: just moderately capable food synthesizers.
scifi.stackexchange.com/users/231/dmckee --- ex-moderator kitten
Tom Swift and the Space
Solartron had a way of generating water, oxygen, and components of food via a cyclotron of some sort.
(The energy that relativity requires to accelerate closer and closer to the speed of light became stable mass, even after the items slowed down).
This is from 1958
(Second Tom Swift series.
My local used book store has some of the first series, but wants $600 a book for it.)
scifi.stackexchange.com/users/176/geoffc
I can not say with authority (still working on reading everything)
however, please take a look at this: http://www.aliencuisine.com/commentary/food-and-science-fiction-science-fiction-and-food/
scifi.stackexchange.com/users/4884/Javamano Mano
The original Buck Rogers comic strips had several instances where humans created food (and other material goods) through the use of "Electical Rays".
That was in the 1920's so it doesn't beat the Verne reference.
scifi.stackexchange.com/users/4241/SteveED
Charles Tanner's Tumithak of the Corridors (1932) describes a post-invasion underground society where ancient machines manufacture food from rocks.
Neat trick, no?
scifi.stackexchange.com/users/16019/The 13th Doctor
I'm referring to devices like Star Trek  replicators  and matter compilers in Neal Stephenson's  Diamond Age . Are you aware of any earlier occurrences of such devices in literature or cinema?
What was the first known mention of artificial food generators?
scifi.stackexchange.com
<history-of><technology><science-fiction-genre><replicator>
scifi.stackexchange.com/questions/7165
scifi.stackexchange.com/users/1859/Phonon
Jules Verne alluded to this concept in "In the Twenty-Ninth Century. Some of Niven's stories (e.g.  At the Core ) from the 70's have  "autochefs"  that seem to synthesize food on demand. The original Buck Rogers comic strips had several instances where humans created food (and other material goods) through the use of "Electrical Rays".  Charles Tanner's  Tumithak of the Corridors  (1932) describes a post-invasion underground society where ancient machines manufacture food from rocks. There are some references to synthetically producing food such as; Tom Swift and the Space, Buck Roger comics, Charles Tanner's Tumithak of the Corridors etc. Not all are exactly the same, but are similar in nature. 
There are some references to synthetically producing food such as; Tom Swift and the Space, Buck Roger comics, Charles Tanner's Tumithak of the Corridors etc. Not all are exactly the same, but are similar in nature. 