The simple answer to your question is, the quoted reference uses the original meaning of "light-hearted, carefree; manifesting, characterized by, or disposed to joy and mirth; exuberantly cheerful, merry; sportive."
However, this question deserves a more detailed answer
How the definition of the word "gay" changed from its original to what we understand it to mean today is a valuable study in how language changes.
The word gay arrived in English during the 12th century from Old French gai, most likely deriving ultimately from a Germanic source. In English, the word's primary meaning was "joyful", "carefree", "bright and showy", and the word was very commonly used with this meaning in speech and literature. (Source)
Indeed, native English speakers still recognize that original meaning. We can easily comprehend by context when the word isn't being used in its modern context. However, our various countries and cultures are slowly weening out the original use in favor of the use of the word today — either to preserve and protect the modern use or to avoid confusion or contention when the old and the still politically charged new collide — but it's fascinating to understand how a word could gain a seemingly new and entirely unrelated meaning.
The word may have started to acquire associations of immorality as early as the 14th century, but had certainly acquired them by the 17th. By the late 17th century, it had acquired the specific meaning of "addicted to pleasures and dissipations," an extension of its primary meaning of "carefree" implying "uninhibited by moral constraints". A gay woman was a prostitute, a gay man a womanizer, and a gay house a brothel. (Ibid.)
By the 1800s the word "gay" had clearly become used in a non-literary and vulgar (bourgeoisie) way to refer to prostitution and the enjoyment of prostitution. Two hundred years ago the word still clearly meant joyous and carefree in tasteful or genteel surroundings — but had gained a clear second meaning that wasn't tasteful or genteel.
The use of gay to mean "homosexual" was often an extension of its application to prostitution: a gay boy was a young man or boy serving male clients. Similarly, a gay cat was a young male apprenticed to an older hobo and commonly exchanging sex and other services for protection and tutelage. The application to homosexuality was also an extension of the word's sexualized connotation of "carefree and uninhibited", which implied a willingness to disregard conventional or respectable sexual mores. (Ibid.)
It's worth noting that by the early and mid 1900s the word "gay" was still commonly and primarily used with its original meaning.
Well into the mid 20th century a middle-aged bachelor could be described as "gay", indicating that he was unattached and therefore free, without any implication of homosexuality. This usage could apply to women too. The British comic strip Jane, first published in the 1930s, described the adventures of Jane Gay. Far from implying homosexuality, it referred to her free-wheeling lifestyle with plenty of boyfriends. (Ibid.)
But the vulgar use of the word was gaining a more narrow view. Less and less did it refer generally to prostitution. More and more it was used to label male homosexual behavior. At that time such behavior was still deemed not just immoral, but illegal in most English speaking countries.
By the mid-20th century, gay was well established in reference to hedonistic and uninhibited lifestyles and its antonym straight, which had long had connotations of seriousness, respectability, and conventionality, had now acquired specific connotations of heterosexuality. In the case of gay, other connotations of frivolousness and showiness in dress ("gay apparel") led to association with camp and effeminacy. This association no doubt helped the gradual narrowing in scope of the term towards its current dominant meaning, which was at first confined to subcultures. Gay was the preferred term since other terms, such as queer, were felt to be derogatory. Homosexual is perceived as excessively clinical, since the sexual orientation now commonly referred to as "homosexuality" was at that time a mental illness diagnosis in the Diagnostic and Statistical Manual of Mental Disorders (DSM). (Ibid.)
And that brings us to its modern meaning. In summary:
In the 12th century and remaining as a minor definition today, the word "gay" meant and means joyful, frivolous, happy, carefree, etc.
By the 17th century, the "carefree" meaning of the word had come to be used as a subculture term to refer to prostitution.
In the 18th century, the subculture meaning had begun to narrow to refer to male homosexual prostitution.
By the 19th century, the subculture meaning had narrowed further to male homosexuality (not just prostitution).
In the 20th century, acceptance of the subculture meaning had begun to expand in the general English speaking population.
By the 21st century, the subculture meaning had become the dominant primary meaning, helping pave the way to homosexuality becoming acceptable and permitting medical, psychological, and scientific examination to begin to understand a far greater meaning of gender and gender preference.
So... how do native English speakers "easily comprehend by context" the word's use with its original meaning?
I don't believe there has been an official study of this, but based on my own personal experience and the use of the two meanings in my area (Northwestern U.S.), the context depends on both adjectives and the surrounding text that helps us determine if the author is describing an emotion (original definition) or a physiological condition (modern definition).
The quote you provide is an adequate example. The quotation is reasonably describing the emotions of the young man, not his sexuality or sexual preference.
Addendum: My thanks to @gidds for pointing out that the age of the text is a strong indicator of context. I noted the age of the OP's quote, but didn't think twice about it. Nevertheless, I have no doubt that it very strongly influenced my decision about context.