The metal-catalyzed dehydrogenation of alcohols without any oxidant or additive has been demonstrated as an atom-economic and environmentally friendly strategy for carboxylic acid synthesis. Among the various catalysts applied to this transformation, Ru-based homogeneous ones have been the most extensively studied owing to their remarkable catalytic activity. However, these catalysts required multiple complicated synthesis steps. In addition, they were either difficult to recycle or their recovery processes were relatively tedious. Therefore, a series of Ru-containing heterogeneous catalysts with zeolitic imidazolium frameworks (ZIFs)-derived materials were designed and fabricated. A thorough screening of various parameters was conducted, and it was found that the material obtained by loading a Ru concentration of 0.05 mol/L into Co species embedded in porous N-doped carbon (Ru0.05@Co-NC) had the best catalytic performance in this transformation, affording a handful of carboxylic acid products from the corresponding aromatic or aliphatic alcohols in moderate to high yields. Additionally, the catalyst showed remarkable recyclability as it could be recycled eight times with stable activity fluctuation (45–52%). It is noteworthy that catalyst recycling was convenient and fast, which could be realized simply by an external magnet. Moreover, the stable morphology and structure of Ru0.05@Co-NC, along with its high specific surface area, hierarchical pore structure, high porosity, and other properties, jointly contributed to its high catalytic activity and good recyclability. Furthermore, the stability and activity of Ru0.05@Co-NC were further evaluated through acid etching experiments, which revealed that some Ru species could stably exist in concentrated acids and play a pivotal role in promoting this catalytic process.