About the hypotheses for a ring to contain a maximal ideal

Most proofs I see that every ring has a maximal ideal (with Zorn's lemma) assume that the ring is commutative and has unit. However, while working out my own proof - assuming that ideals for non commutative rings are bilateral - I did not use the commutativity hypothesis. Either my proof is wrong or the commutativity hypothesis is superfluous. I was wondering which of this conditions, between commutativity and having unit, is necessary for the theorem to hold.

Having a unit is definitely necessary. Consider the ring $\mathbb{Q}$ where addition is normal addition but multiplication is given by $x\cdot y =0$ for all $x,y \in \mathbb{Q}$. Then ideals are simply additive subgroups of $\mathbb{Q}$ of which there are no maximal elements. This post talks about some more interesting examples A (non-artificial) example of a ring without maximal ideals
The condition that $R$ be commutative is not necessary. It sounds like your proof would be correct. The same outline of a proof is given here.
• @Zvi Yes perhaps my use of ''necessary'' is a bit misleading but I think it is how the OP intended the word to be used. As in if the condition that $R$ has a unit is dropped, then the theorem is no longer true. The first question I linked to has some discussion on necessary and sufficient conditions. – michaelhowes Sep 20 '18 at 10:00