The Mishna (10b) lists as examples a number of expressions that are considered to be statements of a vow. Among them is someone who says “this object should be like Jerusalem (ke-Yerushalayim),” because we consider that to be equivalent to saying that the object should be forbidden, like a sacrifice. The Mishna closes with the statement of Rabbi Yehuda that saying just “Jerusalem” will not be considered a vow.
The Gemara offers two approaches to understanding Rabbi Yehuda’s position. One possibility is that the entire Mishna is the opinion of Rabbi Yehuda, who believes that saying ke-Yerushalayim creates a neder, even though saying just Yerushalayim will not be a neder. The other possibility is that Rabbi Yehuda does not think that Yerushalayim is a meaningful statement in the context of nedarim. Such a statement will only be effective in creating a neder if it is made on something that is specifically brought to Jerusalem for sacrifice.
Most of the commentaries (Rashi, the Rosh and others) agree that the question here is whether the walls and towers that encircle Jerusalem were built with Temple funds, which would give them the status of a davar ha-nadur – something that was consecrated to the Temple. According to the opinion that the city itself was not built from holy funds, relating to the city will not create a neder. Tosafot suggest that all parties to this discussion may agree that the city was built from consecrated funds, and the difference of opinion is based on the question of how we interpret the vow made by the individual who invoked Jerusalem. Was his intent to make his vow parallel to the walls of the city, which are a davar ha-nadur and will effectively create a neder, or was his intention to relate to the intrinsic holiness of Jerusalem itself, which is not a davar ha-nadur and will not allow the vow to take effect?