Learning to play guitar by ear is a hot topic that comes up often, along with arguments for or against the need to learn music theory. Is it possible to learn to play guitar by ear? Of course it is, however, it's a bit of a pointless way of thinking about it. The thing is, unless you are learning to play guitar purely by playing written music then you are learning by ear anyway. That counts for whether you learn music theory of not. It's a natural part of the learning process.
What a lot of musicians, especially guitarists, seem to miss the point on is this. Learning to play by ear is something that you should be doing anyway. In fact, if you take music theory seriously then aural training will play a major part in your learning. The argument against theory is a silly one. Remember this, music theory isn't, and never has been, a set of rules that you should adhere to when playing music. In fact, it's the complete opposite of that. Music theory is nothing more than an explanation of what works musically, based on what has already been established by those that play purely by "ear".
In other words, what sounds good comes first. Music theory then attempts to explain why it works and formulise it. This gives musicians a medium by which we can communicate and explain what we are doing musically. You don't have to learn music theory to become a great guitarist. Chances are however, you will become a better musician if you do learn music theory simply because you will make available to you a lot more options and information in your learning. If a teacher is demonstrating something, he may be communicating or explaining the method by use of music theory as a language.
The more you understand what the teacher is talking about, the more options you give yourself when you try to put it to practice. Learning to play guitar by ear is still very much a part of that process. Theory is just a set of tools to make things easier, but you will always need to use (and learn by) using your ears to decide not only if something sounded good but also when improvising, your ear will be the tool you use to try and play what you hear in your head.
Understanding theory will not hamper that process; it will only make it better. So the argument here is, should you learn to play by ear ... and the answer is absolutely! You can do it with or without music theory but it's simply better to do both.