Ramsey has been a key figure in Arsenal's surprise challenge for the English Premier League title and the Welsh international's injury is a major blow to the Gunners' hopes.
He limped off in the 65th minute at Upton Park to ruin his 23rd birthday. Arsenal now face league matches against Newcastle United and Cardiff City and then an FA Cup tie with north London rivals Tottenham Hotspur.
"It looks like a thigh strain," Arsenal manager Arsene Wenger said. "For me, I don't know how serious the thigh strain is but the Christmas period is certainly over for him. It was his birthday today.
"I don't know how long it will be. We will have to see tomorrow morning. He knew straight away, but we have to see."
Theo Walcott's brace and a strike from the returning Lukas Podolski saw Arsenal recover from Carlton Cole's goal against the run of play to take the points in east London. The result, combined with Manchester City's 2-1 victory over Liverpool meant Arsenal went top of the Premier League after a full Boxing Day schedule.