Gnabry and Ramsey send Gunners two points clear at the top
After an uninspiring first half, Ramsey set up German youngster Serge Gnabry for the game's first goal in the 58th minute.
And the former Cardiff City midfielder produced a composed finish himself just a few moments later as Arsenal recorded their eighth Premier League away win in succession.
With a lengthy injury list, Arsenal – who are missing the likes of Santi Cazorla, Theo Walcott, Lukas Podolski and Alex Oxlade-Chamberlain – made nine changes from the side that beat West Brom on penalties in the League Cup on Wednesday, retaining only German pair Gnabry and Per Mertesacker.
Swansea saw their defence of the League Cup end at Birmingham City in midweek, and they kept just four players in their team, recalling Spanish star Michu, although they were without injured defensive pair Ashley Williams and Angel Rangel (both ankle).
Jonathan De Guzman and Jonjo Shelvey both fired over in the early stages for the hosts while Ramsey shot wide from distance, but despite both sides enjoying good spells of possession, they failed to penetrate in a dull first half that saw neither produce a shot on target.
Arsenal goalkeeper Wojciech Szczesny was almost caught out after a heavy touch played in Michu, but an offside flag avoided further embarrassment for the Polish goalkeeper, while a De Guzman free-kick was blasted over in an effort that summed up the first 45 minutes.
The visitors should have scored in first-half stoppage time though, with an excellent Gnabry run finishing with Olivier Giroud, but the Frenchman, who had gone down with an ankle injury a few moments earlier, dragged his effort wide.
The second half started slowly, with Szczesny forced to charge off his line to deny Michu, but Arsenal won the game thanks to four minutes of brilliance.
The lively Gnabry opened the scoring just short of the hour, making the most of a neat Ramsey flick to slot a cool finish beyond Swansea goalkeeper Michel Vorm and into the bottom corner.
Mesut Ozil nearly doubled Arsenal's lead less than a minute later but saw his near-post effort saved by Vorm, before a counter-attack that ended with Ramsey saw the Welshman maintain his scoring run.
An excellent team move that also involved Jack Wilshere and Giroud saw the latter cut back for Ramsey, and the goalscorer took a touch before smashing an effort into the top corner to delight the travelling fans.
Nathan Dyer forced Szczesny into a terrific save as Swansea pressed for a goal and defender Ben Davies gave them a lifeline with eight minutes to play.
The left-back ran forward and played in substitute Wilfried Bony, and Davies followed his run, collecting Bony's lobbed pass and finishing beyond Szczesny.
It was a terrific goal but time ran out for Swansea, as Arsenal won again ahead of a mouth-watering UEFA Champions League clash against Rafael Benitez's Napoli on Tuesday.