On January 12, 2024, Ramírez signed a minor league contract with the Miami Marlins organization. He made 7 appearances for the Triple–A Jacksonville Jumbo Shrimp, posting a 3.86 ERA with 16 strikeouts and 3 saves in 11+2⁄3 innings. On April 28, Ramírez was selected to the 40-man roster and promoted to the major leagues for the first time.