So if the Rich Young Ruler had (in faith) obeyed the commands of God, his works would mean something. This does not suggest he could earn his salvation but rather it would be a testimony to the Holy Spirit working within him. Instead, he was an idolater and his understanding of the law was of the letter not the spirit. He had no real faith to speak of and when standing before Christ and receiving a face to face invitation from Him - he turned away. He wasn't interested.