Gervacio was originally signed as an undrafted free agent by the Houston Astros on December 3, 2002. Gervacio began playing in the minor leagues in 2005, playing for the Rookie League Greeneville Astros and the Single-A Lexington Legends. Gervacio had a 3-2 record with a 2.67 ERA for Greeneville and led the team in games pitched (21), saves (8), and was tied for second in strikeouts with 53. Gervacio also made 5 relief appearances for the Legends, getting one win with an 0.96 ERA.
In 2006, Gervacio played for the Legends again, this time for an entire season. With a 7-5 record and a 2.47 ERA, he led the team in games pitched (47) and saves (10).
In 2007, Gervacio began the season for the Single-A Salem Avalanche. He had a 1-3 record with a 2.44 ERA and led the team with 18 saves. On August 5, Gervacio was promoted to the Double-A Corpus Christi Hooks, where he finished the season. For the Hooks, he went 3-2 with a 1.99 ERA.
On November 20, 2007, the Astros purchased Gervacio's contract, protecting him from the Rule 5 Draft.
On July 30, 2009, Gervacio was called up to the Houston Astros from Triple-A Round Rock after the Astros released Russ Ortiz.
Gervacio signed a one-year minor league contract with the Astros for the 2011 season, with an invitation to spring training.