There is nothing wrong with your request. Please know that all around the world, highly educated English speakers say "can you (do something clearly within your ability to do)". It's called informal speech. It's allowed. It's even looked upon kindly by the beleaguered masses who had to memorize grammar rules.
Your friend told you that you needed to "learn grammar" when you asked him (quite reasonably),
Can you carry this book?
He should have carried it, as he clearly understood what you were asking of him. He thought that if you were well versed in the rules of grammar, you would have asked:
Will you carry this book?
Because will asks about the willingness to carry the book, while can asks about the ability to carry the book. Since it was clear to you both that he was able, you were using the wrong word.
He is a prescriptivist.
A prescriptivist tells people that they should speak/write a certain way based on a set of rules. They believe in a right way and a wrong way to use language. They are not so concerned that language changes along with cultures, situations, etc.
Descriptive grammar, on the other hand, concerns itself with the structure of a language as it is actually used by speakers and writers. It is concerned with communication, not handing out a set of rules on how you should use words.
There is a middle road as well. That's where most of us live. We are willing to disobey our grammar school English teachers and say we "Googled" something, or ask can you give me a hand knowing full well that we aren't asking someone if they are able to cut off their hand and give it to us.
Next time your friend tells you that you should learn grammar, ask him if he understood you. If there was no failure to communicate, ask him if he'd like a ruler. If he doesn't understand this, tell him prescriptivists like rulers so that they can rap a person's knuckles when he breaks the rules.
Sorry for the length of this answer.