You've got basically the right idea. Just for clarity, let me recap the setup: suppose that your ring is centered at the origin and oriented in the xy plane. Consider two differential elements of charge, $\mathrm{d}q$ located at $(R,0)$, and $\mathrm{d}q'$, located at $(R\cos\phi,R\sin\phi)$. The potential energy of these two charge elements is
$$\mathrm{d}^2U = k\frac{\mathrm{d}q\mathrm{d}q'}{r}$$
The distance between the two differential charges is
$$r = \sqrt{(R - R\cos\phi)^2 + (R\sin\phi)^2} = R\sqrt{2 - 2\cos\phi}$$
You can easily generalize this to apply to any two differential elements of charge located at angles $\theta_1$ and $\theta_2$, by just replacing $\phi$ with the angular difference between them, $\theta_1 - \theta_2$.
Now in theory, you should be able to determine the potential energy of the ring by integrating over all possible pairs of charge elements:
$$\begin{align}U &= \iint\mathrm{d}^2U\\
&= k\int_0^{2\pi}\int_0^{2\pi}\frac{\rho R\mathrm{d}\theta_1\rho R\mathrm{d}\theta_2}{R\sqrt{2 - 2\cos(\theta_1 - \theta_2)}}\\
&= k\rho^2 R\int_0^{2\pi}\int_0^{2\pi}\frac{\mathrm{d}\theta_1\mathrm{d}\theta_2}{\sqrt{2 - 2\cos(\theta_1 - \theta_2)}}
\end{align}$$
But oops, guess what, the integral doesn't converge! So it's clearly not that easy.
In fact, it actually makes sense that this integral shouldn't converge. Think about the potential energy contributed by a pair of charge elements $\mathrm{d}q_1$ and $\mathrm{d}q_2$ which are very close to each other. The denominator of $\mathrm{d}^2U$ becomes very small, and as the separation goes to zero, the contribution to the potential energy becomes infinite. It turns out that if you're doing the equivalent calculation for a surface or volume charge distribution, the "spread" of the charge in 2 or 3 dimensions is enough to keep the integral from diverging, but not so with a line charge. So the bottom line is that the potential energy is infinite.
In practice, this isn't really an issue because any realistic charge distribution is constructed by pushing together existing pieces. You can never actually get the pieces to be right next to each other, so you don't have the problem with $r = 0$ in the denominator. It does interest some theorists, though, to figure out what's going on with this sort of situation and whether it makes sense on some fundamental level to have a theory in which a simple, sensible calculation like this turns out to be infinite.