There are so many people wondering why Cain's gift was not acceptable to God, and scripture is not really clear on it. There are 3 things that I see as possiblities - 1) God usually asked for blood to be shed as part as an offering, as when he killed animals to clothe Adam & Eve, later in the temple sacrifices, and with the ultimate sacrifice of his Son Jesus Christ. 2) Abel brought the first of his flock, while Cain simply bought the fruit of the ground - he did not put God in the place of priority, reserving the first and best for Him. 3) His attitude was wrong - he seemed to come to God seeking acceptance and approval, not sacrificing as a sign of gratefulness and thanksgiving for what he had, or else he would not be so fickle and quick to anger. God demanded that men's hearts be pure while they offered a sacrifice to Him, not full of envy,hatred, or false motives.

Genesis 4:3-5