The Rays signed the veteran shortstop Thursday, four days after Ramirez was released by the Padres and a day after Matt Duffy was shut down for the year with a left Achilles injury that requires surgery.
"This kind of caught me by surprise," Ramirez said through an interpreter. "It's nice, because I'll be close to home [in Miami]. I told them I can play any position."
The Rays signed Ramirez to fill the open spot at shortstop, but manager Kevin Cash said he also plans to use Brad Miller and Nick Franklin at the position. Miller started at short Thursday night against the Yankees, but after getting hit by a pitch in the first inning, he shifted over to first base and Franklin slid over to shortstop. Ramirez entered the game in the second at shortstop when Miller exited the game and Franklin stayed at first base.
Miller, who moved from shortstop to first base when the Rays traded for Duffy on Aug. 1, will continue as the primary first baseman.
"Brad Miller is our first baseman," Cash said.
With the Rays wanting to see Franklin continue to develop as a multi-position player, they were left needing someone who could fill in at short.
Ramirez, a 34-year-old who originally signed with the White Sox after defecting from Cuba, was a natural choice. He has played 1,212 Major League games at shortstop.
Ramirez debuted with the White Sox on Opening Day 2008, just 13 days before Longoria debuted with the Rays.
Ramirez left the White Sox as a free agent last offseason, signing a one-year, $4 million deal with the Padres. He batted .240 with a career-low .605 OPS in 128 games before he was released.
"Getting released was something that was out of my hands," Ramirez said. "I'm thankful to San Diego for giving me the opportunity to play. If that's the decision they felt was right for the team, I respect it."
Ramirez started just 11 games for the Padres since the beginning of August, but he said he's ready to play as soon as the Rays need him.
"It's not like I've been out of baseball," he said. "The few days of rest [after getting released] was actually good for me. I'm ready to play."