Surface-enhanced Raman scattering (SERS) spectroscopy technology has broad application prospects in food safety, environmental monitoring, surface science and material analysis because of the characteristics of ultra-high sensitivity and non-destructive testing. However, there are still some challenges in the preparation of SERS substrates. As SERS substrates, the common colloidal noble metal nanoparticles usually show low storage stability and poor repeatability of analytical results. In order to overcome these limitations, a coaxial microfluidic spinning device was designed to prepare flexible SERS substrates in this paper. Based on the microfluidic spinning and subsequent in-situ reduction reaction of AgNO3, novel gel fibers uniformly loaded with AgNPs were successfully prepared. The effects of the concentration of AgNO3 solution and UV irradiation duration on the formation of AgNPs were investigated. Transmission electron microscopy (TEM) showed that the average particle size was about 2.7 nm. The gel fibers loaded with AgNPs were used as SERS substrates to detect 4-mercaptobenzoic acid (4-MBA), which showed obvious Raman enhancement effect and good repeatability. The relative standard deviation of 10 test results was 4.75%, and the detection line range was 10-14-10-5 mol·L-1.