The following excerpt is from pp. 246–247 of Paolo Aluffi's Algebra: Chapter 0:
1.2. Prime and irreducible elements. Let $R$ be a (commutative) ring [with $1$], and let $a,b\in R$. We say that $a$ divides $b$, or that $a$ is a divisor of $b$, or that $b$ is a multiple of $a$, if $b\in(a)$, that is $$ (\exists c\in R), \quad b = ac. $$ We use the notation $a \mid b$.
Two elements $a,b$ are associates if $(a) = (b)$, that is, if $a\mid b$ and $b\mid a$.
Lemma 1.5. Let $a,b$ be nonzero elements of an integral domain $R$. Then $a$ and $b$ are associates if and only if $a = ub$, for $u$ a unit in $R$.
[Proof omitted.]
Incidentally, here the reader sees why it is convenient to restrict our attention to integral domains. This argument really shows that if $(a) = (b) \ne (0)$ in an integral domain, and $b = ca$, then $c$ is necessarily a unit. Away from the comfortable environment of integral domains, even such harmless-looking statements may fail: in $\Bbb Z/6\Bbb Z$, the classes $[2]_6,[4]_6$ of $2$ and $4$ are associates according to our definition, and $[4]_6 = [2]_6\cdot[2]_6$, yet $[2]_6$ is not a unit. However, $[4]_6 = [5]_6\cdot [2]_6$ and $[5]_6$ is a unit, so this is not a counterexample to Lemma 1.5. In fact, Lemma 1.5 may fail over rings with 'non-harmless' zero-divisors (yes, there is such a notion) [emphasis added].
Since at this point, Aluffi does not say what such rings are called, I was hoping someone might know what type of rings Aluffi is referring to. (And hopefully provide a little context as to why they are interesting!)