Here is an example due to Kaplansky.
Let $R=C([0,3])$ be the ring of continuous funtions $f:[0,3]\rightarrow\mathbb{R}$. I claim that
$$R^{\times}=\left\lbrace f(t)\in R \hspace{2.5mm} | \hspace{2.5mm} f(t)\neq 0 \hspace{2.5mm} \forall t\in[0,3]\right\rbrace.$$
Indeed, if $f(t)g(t)=1$ for all $t\in[0,3]$ then $f(t)\neq 0$ because if there exists $s\in [0,3]$ such that $f(s)=0$ then $1=f(s)g(s)=0\cdot g(s)=0,$ a contradiction. Conversely, if $f(t)\neq 0$ then $\frac{1}{f(t)}\neq 0$ is a continuous function.
Now define the three elements
$$a(t)=\begin{cases}1-t&t\in[0,1]\\0&t\in[1,2]\\t-2&t\in[2,3]\end{cases},$$
$$b(t)=\begin{cases}1-t&t\in[0,1]\\0&t\in[1,2]\\2-t&t\in[2,3]\end{cases},$$
and
$$c(t)=\begin{cases}1&t\in[0,1]\\3-2t&t\in[1,2]\\-1&t\in[2,3]\end{cases}.$$
Then $a(t),b(t),c(t)\in R$ and it's clear that $c(t)a(t)=b(t)$ and $c(t)b(t)=a(t)$, so $a(t)\mid b(t)$ and $b(t)\mid a(t)$.
Let $u(t)\in R^{\times}$ be given. If $a(t)=b(t)u(t)$ then
$$a(t)=\begin{cases}1-t&t\in[0,1]\\0&t\in[1,2]\\t-2&t\in[2,3]\end{cases}=\begin{cases}(1-t)u(t)&t\in[0,1]\\0&t\in[1,2]\\(2-t)u(t)&t\in[2,3]\end{cases}=b(t)u(t),$$
which implies that
$$u(t)=\begin{cases}1&t\in[0,1]\\\star&t\in[1,2]\\-1&t\in[2,3]\end{cases}.$$
But due to the Intermediate Value Theorem we see that there exists $s\in[0,3]$ such that $u(s)=0$ because it attains all the values between $-1$ and $1$. Thus we conclude that $u(t)$ is not a unit and therefore we see that $a(t)$ and $b(t)$ are not associates.