I am following an argument in chapter zero of Eisenbud's Commutative Algebra book. It is not clear whether or not he is assuming that $R$ is a domain. If I start the proof assuming $R$ is not necessarily a domain this is what I get:
Suppose that $R$ (commutative ring with identity) satisfies ACC on principal ideals but there exists a non-unit $a_1\in R$ such that $a_1$ does not admit a factorization into irreducibles. As $a_1$ is not irreducible, $a_1=bc$, with both $b$ and $c$ non-units.
Both $b$ and $c$ cannot have factorization into irreducibles since in that case we would have a factorization into irreducibles of $a_1$. So WLoG, assume that $b$ has no factorization into irreducibles.
Set $a_2=b$. Then we have $(a_1)\subsetneq (a_2)$.
This is where I am stuck. It is clear that $(a_1)\subset (a_2)$, since $a_1=a_2 c$. But I get stuck showing that $(a_1)\neq (a_2)$. What is frustrating me is that I can show with ease that $(a_1)\neq (a_2)$ if $R$ is a domain (or even if $a_1$ is not a zero divisor) but not otherwise.
The rest of the argument is straight forward. Continue picking the $a_i$ inductively and get a non-terminating ascending chain of principal ideals; contradicting ACC.
It is indeed not too clear from the context, but Eisenbud is assuming $R$ to be a domain in this argument. Here's a counterexample if $R$ is not a domain:
Take $R = \prod_{i=1}^n \mathbb{F}_2$ (the field with $2$ elements), with $n > 1$. Then $R$ has only one unit (namely $1$), and every nonunit admits nontrivial factorizations into nonunits (if $a = (a_1, \ldots, a_n)$ is not a unit, then $a_i = 0$ for some $i$, and then $a = a \cdot (1, \ldots, 1, 0, 1, \ldots, 1)$ with $0$ in the $i^{\text{th}}$ spot). This shows that $R$ has no irreducible elements. But $R$ is Noetherian, hence satisfies ACC on all ideals, and thus in particular also on principal ideals.
(Note: the exact same construction works if $R$ is any finite direct product of fields, although there are more units.)