(g hard) properly means “dress.” In machinery, the bands
and wheels that communicate motion to the working part are called the
gearing. (Saxon, gearwa, clothing.)
In good gear.
To be in good working order. Out of gear.
Not in working
condition, when the “gearing” does not act properly; out of health.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894