Ruthenium (Ru)-based materials have been proven to be highly efficient hydrogen evolution reaction (HER) electrocatalysts and have become the most promising candidates for replacing platinum (Pt)-based electrocatalysts. Herein, we report an easily scalable electrospinning strategy to construct nitrogen-doped carbon nanofibers with porous hierarchical structures and uniformly dispersed Ru nanoparticles (abbreviated as ES-Ru-ZIF-900). Benefiting from the porous fibrous nanoarchitecture caused by the pyrolysis of the zeolitic imidazolate framework-8, the abundant firmly immobilized Ru NPs, and the high conductivity of the N-doped carbon matrix, the resultant ES-Ru-ZIF-900 electrocatalyst exhibits an extraordinary HER performance. ES-Ru-ZIF-900 only needs an overpotential of 21 mV to drive the current density of 10 mA cm(-2), and possesses long durability for over 14 h in 1.0 M KOH, superior to Pt/C and most of the non-Pt based electrocatalysts. This work offers a universal and efficient synthetic strategy for preparing metal-based nitrogen-doped carbon hybrid catalysts with enhanced HER activity.