For a counterexample, I will use the ring $R := \mathbb{Z}[a, b, r, s] / \langle b - ra, a - sb \rangle$. In this ring, we certainly have $b = ra$ and $a = sb$. It remains to show there is no unit $u \in R^*$ such that $b = ua$.
Thus, suppose we did have $b = ua$. Then $a(u-r) = 0$. On the other hand (and here is where the argument gets somewhat technically involved), it can be shown that the kernel of the $R$-module homomorphism $a\cdot : R \to R$ is generated by $rs - 1$. Therefore, there exists $p \in R$ such that $u = r + p(rs - 1)$. Also, if $u$ is a unit, then the image $\bar u$ of $u$ in $R / \langle a, b \rangle \simeq \mathbb{Z}[a,b,r,s] / \langle b - ar, a - sb, a, b \rangle = \mathbb{Z}[a,b,r,s] / \langle a, b \rangle \simeq \mathbb{Z}[r,s]$ would also have to be a unit. But the only units of $\mathbb{Z}[r,s]$ are the constant polynomials $\pm 1$, whereas with $\bar u = r + \bar p (rs - 1)$ we would need to have $\bar u(1, 1) = 1 \ne -1 = \bar u(-1, -1)$ if we consider $\bar u$ as inducing a function $\mathbb{Z}^2 \to \mathbb{Z}$. This gives a contradiction, so the assumption that $u$ is a unit must have been false.
The basic idea here is that we are in some sense taking the "universal example" of a ring with two associate elements $a,b$ (though with the caveat that the elements $u,v$ making the elements associate are also distinguished, rather than simply assumed to exist somewhere in the ring; and also that the actual universal example would be $\mathbb{Z}[a,b,r,s] / \langle b-ra, a-sb \rangle$ whereas I used $\mathbb{Q}$ for a slightly easier time with the technical details I omitted). If we had found a unit within $\mathbb{Q}[a,b,r,s] / \langle b-ra, a-sb \rangle$ making $a$ and $b$ associates, then that expression would have worked in particular for any $\mathbb{Q}$-algebra. On the other hand, once we instead found that there is no unit in this universal example, we already had our counterexample that we needed.
(On the other hand, this shows that trying to work directly with the universal example might not always be the best or easiest approach. In this example, we had some mildly hairy calculations, ultimately based on Groebner basis theory, that were needed. However, in the counterexample based on $R = C[0,3]$ in another answer, it was more straightforward to check the details.)
Addendum on the technical detail omitted above, verifying the fact in Macaulay2:
Macaulay2, version 1.16
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases, MinimalPrimes, PrimaryDecomposition, ReesAlgebra, TangentCone, Truncations
i1 : R = ZZ[a,b,r,s] / (b - ra, a - sb)
o1 = R
o1 : QuotientRing
i2 : mult_a = map(R^1, R^1, matrix {{ a }})
o2 = | a |
1 1
o2 : Matrix R <--- R
i3 : kernel(mult_a)
o3 = image | rs-1 |
1
o3 : R-module, submodule of R