There's a fairly standard proof that the rank of a free module $F$ over a commutative ring $R$ is well defined. We take a maximal ideal $I$ and note that $R/I$ is a field. Taking $R/I \otimes_R F$ gives a vector space of dimension rank of $F$, which gives the result.
I was wondering where the proof breaks down in the non-commutative case (let's assume we have a unit). According to the wikipedia article on Division Rings, every module over a division ring is free with well-defined rank, and I don't see any issue with taking a maximal ideal (do we need to be careful with selecting maximal left/right/two-sided ideals?) or with taking the tensor product. If someone could point out what's wrong that would be greatly appreciated.