In a commutative ring, GCD exists implies LCM exists? I am trying to prove the following :

Let $R$ be a commutative ring with unity, $a,b\in R$; suppose $(a)+(b)$ is principal. Show that $(a)\cap(b)$ is principal.
(Hint: first look at $R=\mathbb{Z}$ to gain some insight).

In $\mathbb{Z}$ if have $d=\gcd(a,b)$ then $(d)=(a)+(b)$, and if $m=\text{lcm}(a,b)$ then $(m)=(a)\cap(b)$ and $m=\displaystyle\frac{|ab|}{d}$, so my idea is to prove that $(a)\cap(b)=\displaystyle\Big(\frac{ab}{d}\Big)$ holds in $R$.
Since $(a)+(b)=(d)$ is principal we know that $\gcd(a,b)$ exists because:
$c|a,b\iff (a),(b)\subset (c)\iff (d)\subset (c)\iff c|d$.
If $(a)\cap(b)=(m)$ were to be principal then $\text{lcm}(a,b)$ would exist because:
$a,b|n\iff (n)\subset (a)\cap(b)=(m)\iff m|n$.
Now $d|a,b$ so $a,b|\displaystyle\frac{ab}{d}$ and $\displaystyle\Big(\frac{ab}{d}\Big)\subset(a)\cap(b)$. If $n\in(a)\cap(b)$ then $(dn)=((a)+(b))(n)=(an)+(bn)\subset (ab)$.
If $d$ is not a zero divisor then $dn\in (ab)\implies n\in\displaystyle\Big(\frac{ab}{d}\Big)$. However if $d$ is a zero divisor we cannot draw this conclusion.
Question: if $(a)+(b)=(d)$ is principal and $d$ is a zero divisor, can we still have that $(a)\cap(b)$ is principal?
I have seen (very closely) related questions discussed on this site, but they generally assume that $R$ is (at least) a domain. I am wondering if I'm missing something simple or if $R$ being a domain is really necessary and should be added to the statement I'm trying to prove. I've tried to prove this result by generalizing other identities between $\gcd$ and $\text{lcm}$ from $\mathbb{Z}$, but I always end up having to assume that $d$ is not a zero divisor to end the proof.
 A: Write $a=\alpha d$, $b=\beta d$, $d(u\alpha+v\beta-1)=0$, $\mu=\alpha\beta d$.
Let $c \in (a) \cap (b)$. Then $c=as=bt=dc’$ for $s,t \in A$. Thus $c\beta \in (\mu)$, $c\alpha \in \mu$, thus $uc\alpha+vc\beta=c’d(\alpha u+\beta v)=c’d=c \in (\mu)$. The reverse inclusion ($(\mu) \subset (a) \cap (b)$) is clear.
A: The trick is to effectively "cancel" $d$ at the start (vs. end) of proof. More precisely, since $\,d\mid a\,$ there exists $\,\frac{a}d\in R\,$ with $\,\frac{a}d\,d = a,\,$ and similarly for $\frac{b}d,\,\frac{n}d\,$ by $\,d\mid a,b\mid n.\,$ Fixing your proof this way:
$$\begin{align} (dn)&=((a)+(b))(n)=\,(an)\,+\,(bn)\subset (ab)\ \ \ \text{upon "cancelling"}\ d\\[.4em] 
{\rm we\ get}\ \ \color{#c00}{(n)} &= ((\frac{a}d)\!+\!(\frac{b}d))\:\!\color{#0a0}n  = (\frac{a}d\,n)\! +\! (\frac{b}d\,n) \subset  (\frac{a}d\,\frac{b}d\,d), \ \ {\rm by}\ \ a,b\mid n\\
{\rm and\ since\ \ \  } &\,\overbrace{((\frac{a}d)\!+\!(\frac{b}d))\, \color{#0a0}{d\,\frac{n}d}} = (\underbrace{(a)+(b)}_{\large (d)})\,\frac{n}d = \color{#c00}{(n)}.\ \ \ {\rm QED} \end{align}\qquad$$
