He will report to the club's Sarasota facility and then join Triple-A Norfolk.
The 32-year-old has pitched in the majors with Colorado, Kansas City, Boston, San Francisco and the New York Mets. He was originally signed by Texas in 1996 out of Santo Domingo, Dominican Republic.
Ramirez is 23-21 with a 3.42 ERA over his big league career. He has been exclusively a reliever, pitching 433 2/3 innings over 423 games and allowing 370 hits with 189 walks and 362 strikeouts.
In 5 2/3 innings over six games with the Giants in 2013, Ramirez went 0-0 with an 11.12 ERA, giving up five runs.
This year with Triple-A Tacoma, he went 0-0 with a 10.38 ERA. In 4 1/3 innings, he gave up six hits and five runs with three walks and five strikeouts. He allowed four runs in his last appearance on April 24.