Collecting rubies by walking on rails