You can find the account of the rich young ruler in Lk 18:18-30, Matt 19:16-22, Mark 10:17-31. The following answer is stolen from Bonhoeffer's book "The Cost of Discipleship" (p30).
The young man has now been twice brought face to face with the truth of the
Word of God, and there is no further chance of evading his commandment. It is
clear there is no alternative but to obey it. But he is still not satisfied.
'All these things have I observed from my youth up: what lack I yet?' Doubtless
he was just as convinced of his sincerity this time as he was before. But it is
just here that his defiance of Jesus reaches its climax. He knows the
commandment and has kept it but now, he thinks, that cannot be all God wants of
him, there must be something more, some extraordinary and unique demand, and
this is what he wants to do. The revealed commandment of God is incomplete,
he says, as he makes the last attempt to preserve his independence and
decide for himself what is good and evil. He affirms the commandment with one
hand and subjects it to a frontal attack on the other.
The guts of Bonhoeffer's answer lies in the words:
The revealed commandment is incomplete and seeking to preserve his independence and decide for himself good and evil.
Bonhoeffer then goes on to add that what he really lacked was (p32):
He had great possessions. The call to follow means here what it had meant
before - adherence to the person of Jesus Christ and fellowship with him. The
life of discipleship is not the hero-worship we would pay to a good master, but
obedience to the Son of God.
It's good stuff - thanks Mr Bonhoeffer!