These are not "the same", but they do give equivalent categories.
Precisely, let us write $\hat{R}$ for the functor $\textbf{Ring}\to \textbf{Set}$ you call $\operatorname{Spec}(R)$ (to avoid using the same symbol for two different things), and $\textbf{LocRingSpc}$ for the category of locally ringed spaces.
Then you can define two functors
$$ \begin{array}{rrcl}
F: &\textbf{Ring}^{op} & \to & \textbf{Set}^{\textbf{Ring}} \\
& R & \mapsto & \hat{R}
\end{array}$$
and
$$ \begin{array}{rrcl}
G: &\textbf{Ring}^{op} & \to & \textbf{LocRingSpc} \\
& R & \mapsto & (\operatorname{Spec}(R), \mathcal{O}_{\operatorname{Spec}(R)}).
\end{array}$$
Then it turns out that these two functors are fully faithful (by Yoneda lemma for $F$ and a standard basic theorem of algebraic geometry for $G$), so the (essential) images of $F$ and $G$ are equivalent categories, which both could be called "the category of affine schemes", although it is more natural to use that term for the image of $G$. You could call the image of $F$ "functorial affine schemes" and the image of $G$ "topological affine schemes" if you want. Of course they are also just equivalent to $\textbf{Ring}^{op}$.
You can go directly from one to the other by restricting
$$ \begin{array}{rcl}
\textbf{LocRingSpc} & \to & \textbf{Set}^{\textbf{Ring}} \\
(X,\mathcal{O}_X) & \mapsto & (R\mapsto Hom_{\textbf{LocRingSpc}}(\operatorname{Spec}(R),X)).
\end{array}$$
to the subcategory of "topological affine schemes".
The point is that it is arguably more natural to extend affine schemes to general schemes by using the locally ringed space definition than by the functorial definition. But in any case the above functor will still give an equivalence between "topological schemes" and "functorial schemes" to pursue with this (arbitrary) terminology.