The phrase "ruin the surprise" is correct and can be used in written English. You can use it when you want to express that someone has taken away the excitement or anticipation of something that was meant to be a surprise. For example, you could say, "Don't tell him what we got him for his birthday - you'll ruin the surprise!".
But don't ruin the surprise.
"It would ruin the surprise".
(To say more would ruin the surprise).
To explain further would be to ruin the surprise.
Frank Williams did not want to ruin the surprise.
Now you can totally ruin the surprise by leaving it under the tree wrapped in this.
But I'm not going to ruin the surprise by telling you how.
Being a terminologist, I care about word choice. Ludwig simply helps me pick the best words for any translation. Five stars!
Maria Pia Montoro
Terminologist and Q/A Analyst @ Translation Centre for the Bodies of the European Union