A compound represented by general formula, (in the formula, L represents -O-, -S-, -SO-, -SO 2 - -NH-, -C -, -CH 2 -O-, -O-CH 2 -, -CH 2 -, or -CH -; R 1 represents a halogen atom, a C 1-4 alkyl group, a C 1-4 alkoxy group, a C 1-4 haloalkyl group, or a C 1-4 haloalkoxy group; ring1 represents a benzene, cyclohexane, or pyridine ring, which may be substituted by from one to five substituents each independently selected from the group consisting of halogen atoms, C 1-4 alkyl groups, C 1-4 alkoxy groups, nitrile, C 1-4 haloalkyl groups, and C 1-4 haloalkoxy groups, wherein when two or more substituents are present on ring1, these substituents may form a 4- to 7-membered cyclic group together with the atoms in ring1 to which these substituents are bonded; ring2 represents a 4- to 6-membered nitrogenous saturated heterocycle, which is substituted by from one to three -K-R2; K represents -C - (wherein the bond on the left is bonded to the ring2); R 2 represents a C 2-4 alkenyl, or a C 2-4 alkynyl group, each of which may be substituted by from one to five substituents each independently selected from the group consisting of NR 3 R 4, halogen atoms, CONR 5 R 6, CO 2 R 7, and OR 8; R 3 and R 4 each independently represent a hydrogen atom, or a C 1-4 alkyl group which may be substituted by OR 9 or CONR 10 R 11; R 3 and R 4 may, together with the nitrogen atom to which they are bonded, form a 4- to 7-membered nitrogenous saturated heterocycle, which may be substituted by an oxo group or a hydroxyl group; R 5 and R 6 each independently represent a hydrogen atom, a C 1-4 alkyl group, or a phenyl group; R 7 represents a hydrogen atom or a C 1-4 alkyl group; R 8 represents a hydrogen atom, a C 1-4 alkyl group, a phenyl group, or a benzotriazolyl group; R 9 represents a hydrogen atom or a C 1-4 alkyl group; R 10 and R 11 each independently represent a hydrogen atom or a C 1-4 alkyl group; n represents an integer from 0 to 4; m represents an integer from 0 to 2; and when n is two or more, the R 1' s may be the same as each other or may differ from one another), an optical isomer thereof or their mixture, a salt thereof, a solvate thereof, or an N-oxide thereof, for use in preventing and/or treating a Btk-related disease. L represents -O-, -S-, -SO-, -SO 2 - -NH-, -C -, -CH 2 -O-, -O-CH 2 -, -CH 2 -, or -CH -; R 1 represents a halogen atom, a C 1-4 alkyl group, a C 1-4 alkoxy group, a C 1-4 haloalkyl group, or a C 1-4 haloalkoxy group; ring1 represents a benzene, cyclohexane, or pyridine ring, which may be substituted by from one to five substituents each independently selected from the group consisting of halogen atoms, C 1-4 alkyl groups, C 1-4 alkoxy groups, nitrile, C 1-4 haloalkyl groups, and C 1-4 haloalkoxy groups, wherein when two or more substituents are present on ring1, these substituents may form a 4- to 7-membered cyclic group together with the atoms in ring1 to which these substituents are bonded; ring2 represents a 4- to 6-membered nitrogenous saturated heterocycle, which is substituted by from one to three -K-R2; K represents -C - (wherein the bond on the left is bonded to the ring2); R 2 represents a C 2-4 alkenyl, or a C 2-4 alkynyl group, each of which may be substituted by from one to five substituents each independently selected from the group consisting of NR 3 R 4, halogen atoms, CONR 5 R 6, CO 2 R 7, and OR 8; R 3 and R 4 each independently represent a hydrogen atom, or a C 1-4 alkyl group which may be substituted by OR 9 or CONR 10 R 11; R 3 and R 4 may, together with the nitrogen atom to which they are bonded, form a 4- to 7-membered nitrogenous saturated heterocycle, which may be substituted by an oxo group or a hydroxyl group; R 5 and R 6 each independently represent a hydrogen atom, a C 1-4 alkyl group, or a phenyl group; R 7 represents a hydrogen atom or a C 1-4 alkyl group; R 8 represents a hydrogen atom, a C 1-4 alkyl group, a phenyl group, or a benzotriazolyl group; R 9 represents a hydrogen atom or a C 1-4 alkyl group; R 10 and R 11 each independently represent a hydrogen atom or a C 1-4 alkyl group; n represents an integer from 0 to 4; m represents an integer from 0 to 2; and when n is two or more, the R 1' s may be the same as each other or may differ from one another), an optical isomer thereof or their mixture, a salt thereof, a solvate thereof, or an N-oxide thereof, for use in preventing and/or treating a Btk-related disease.