Ramirez, who has a career 2.42 ERA but a 5.79 ERA this season, made two appearances with the Brewers, allowing two runs in 1 2/3 innings. The 27-year-old also made four appearances with the Cubs, giving up four runs over 7 2/3 innings before being claimed off waivers by Milwaukee on May 31.
"We like him," Twins general manager Terry Ryan said. "You're always trying to get better."
Ramirez's best season came as a rookie in 2014, when he posted a 1.44 ERA and struck out 53 in 43 2/3 innings. He was limited to 19 appearances last year, as he dealt with shoulder inflammation and abdominal soreness. Ramirez throws a fastball, slider and curveball, but has seen his fastball velocity drop from an average of 94.3 mph in 2014 to 92.1 mph this year.
Rhett Bollinger has covered the Twins for MLB.com since 2011. Read his blog, Bollinger Beat, follow him on Twitter @RhettBollinger and listen to his podcast. This story was not subject to the approval of Major League Baseball or its clubs.