 With the advent of the railways in the 19th century , the area became a tourist attraction . The Duchy of Lancaster undertook maintenance in the 19th century to ensure the castle 's condition did not deteriorate further , mostly by clearing rubble and adding mortar . Sir Walter Scott 's 1823 novel Peveril of the Peak , set in the mid 17th century , described the castle ruins . 
