Back in the 1960s, Lisa Douglas, the Manhattan socialite played by Eva Gabor in the television sitcom “Green Acres,” had to give up her “penthouse view” to indulge her husband’s desire for “farm livin’.”

Today, she could have had both. New York City (the stores!) is suddenly a farming kind of town (the chores!). Almost a decade after the last family farm within the city’s boundaries closed, basil and bok choy are growing in Brooklyn, and tomatoes, leeks and cucumbers in Queens. Commercial agriculture is bound for the South Bronx, where the city recently solicited proposals for what would be the largest rooftop farm in the United States, and possibly the world.

Fed by the interest in locally grown produce, the new farm operations in New York are selling greens and other vegetables by the boxful to organically inclined residents, and by the bushel to supermarket chains like Whole Foods. The main difference between this century and previous ones is location: whether soil-based or hydroponic, in which vegetables are grown in water rather than soil, the new farms are spreading on rooftops, perhaps the last slice of untapped real estate in the city.

“In terms of rooftop commercial agriculture, New York is definitely a leader at this moment,” said Joe Nasr, co-author of “Carrot City: Creating Places for Urban Agriculture” and a researcher at the Centre for Studies in Food Security at Ryerson University in Toronto. “I expect it will continue to expand, and much more rapidly, in the near future.”