– On a recent weekday, just a few miles from where the government was holding military exercises preparing for a foreign invasion, about a dozen senior citizens were gathered in a classroom learning about another wartime innovation.

“Vertical gardens were pioneered during World War II,” a teacher said as he instructed them on how to turn plastic bottles into planters that could be hung on a wall or balcony. “We need to take advantage of every space possible.”

This is Venezuela’s latest weapon in its battle against hunger: urban agriculture.

As the country has been swamped with images of empty shelves, soul-crushing lines and food riots, the administration is urging city-dwellers to embrace modern-day Victory Gardens.

In January, President Nicolas Maduro created the Ministry of Urban Agriculture, saying it was critical to “fight the grave economic situation” being produced by “falling oil prices and the war being waged by the U.S. Empire against our national economy.” More recently, the administration has said metropolitan areas should grow at least 20 percent of their own food.

Petra Meneses, a 66-year-old retired doctor, said the soaring prices of vegetables had driven her to get serious about home gardening. In her neighborhood, a bag of green peppers is running about 1,800 bolívares — that’s about $4 dollars, or almost a tenth of her monthly social security check.

“With everything being so precarious we have to go back to the land,” she said. “Even if that land is inside the city — in our homes.”

Why a country that boasts the world’s largest oil reserves is struggling to keep food on the table is as much about global forces as perverse policies.

Many farmers blame government neglect, expropriations and populist price controls for strangling rural development. Rice, sugar and corn — staples of the Venezuelan diet — all cost more to grow than they can be legally sold for, according to the Federation of Agriculture.

The regulated food that does make it to the store is often scooped up by bachaqueros, people who buy food and household goods to resell them at huge markups on the black market. As a result, while the regulated price of an egg is 14 bolívares, it’s nearly impossible to find one that costs less than 100 bolívares.

To complicate matters, Venezuela has the world’s highest inflation, expected to surpass 500 percent this year, which only exacerbates hoarding.

The result of all these pressures create a confusing montage: apocalyptic lines and bare shelves at stores that sell regulated goods, while neighboring stores that deal in unregulated products might be stocked but at unaffordable prices.

Jaqueline Tavarez, 50, had woken up at 3 a.m. and dragged her 2-year-old grandson across town in hopes of finding some food on a recent weekday. She was number 60 in a line that stretched hundreds of people long to get into a grocery store.

“I will buy whatever I can find,” she said of her shopping list. “Right now, in our neighborhood, I can’t find rice, pasta, yuca or potatoes.”

She said she and her older daughter often skipped meals to keep her grandson fed.

“We just can’t afford it,” she said. “How are we going to pay 4,000 bolívares ($9) for milk or 1,500 ($3) for rice?”

The late President Hugo Chavez first began talking about urban agriculture years ago, before the lines began stretching and prices started soaring, but it never caught on in a nation that has traditionally imported 70 percent of all its goods.

Now, as collapsing oil prices have sapped the country’s ability to bring food in, Venezuela is ripe for adopting the new practice, said Ana Lucia Simons, the National Director of Community Interaction at Simon Rodriguez Experimental University, a state-run institute that has been charged with spreading the gospel of urban agriculture.

“During times of great difficulty there are great opportunities,” she noted.

“We have problems with water, we have problems with production and we have this induced war that has increased prices abysmally,” she said. “In this scenario, if you have a plantain tree, a yuca or tomato plant, it helps resolve your problem a little bit.”

Not surprisingly in polarized Venezuela, the urban farming push is ridiculed by many. The government, they argue, should focus on reviving agriculture in rural areas rather than in the concrete jungle of Caracas.

“Next we’ll have a ministry of raising pigs in the bathroom and hens in our closets,” wrote Laureano Marquez, a comedian and columnist.

Ainda Olivo, a government worker who is trying to spread urban agriculture programs, said there are many reasons to think it will be a success this time. There’s unused land in the city, people aren’t working, and money doesn’t go as far as it once did.

“Before, we didn’t need to do this,” she said. “But as they say, necessity is the mother of invention.”