California’s housing crisis is testing whether Berkeley can remain that kind of place.

Faced with sharp criticism from a changing population, city leaders have banned people from living in recreational vehicles here, proving that even the most accepting of cities is not immune to the demands that often accompany wealth and gentrification. Businesses and residents have complained about the RVs’ blighting of city streets and the burden they place on public safety and sanitation services.

“We had to do something,” said Mayor Jesse Arreguín, referring to the March city council vote. “The ordinance we passed, I will admit we rushed into it. But we were facing a lot of pressure from businesses and residents.”