(Unstable Ruins isn't a spell.)
When Unstable Ruins enters the battlefield, sacrifice it unless you pay 2 life.
,
: Tap target artifact with converted mana cost X or less.
, Pay 1 life, Sacrifice Unstable Ruins: Search your library for a Swamp or Mountain card and put it onto the battlefield, then shuffle your library.