The proof makes substantial use of the fact that the ring $R$ is commutative, so that the quotient $R/\mathfrak{m}$ modulo a maximal ideal $\mathfrak{m}$ is a field.
What you can say in the noncommutative case is that $R/\mathfrak{m}$ is a simple ring (no nonzero proper ideals), when $\mathfrak{m}$ is a maximal (two-sided) ideal.
Alas, there exist simple rings which don't have “invariant basis number”. An easy example is given by the ring $R$ of endomorphisms of the vector space $V$ over a field, assuming that $V$ has an infinite basis.
No endomorphism ring of a non finitely generated vector space has invariant basis number, because $R\oplus R\cong R$ (it's a nice exercise based on the fact that an infinite basis can be partitioned into to disjoint subsets with the same cardinality).
If $\mathfrak{m}$ is a maximal two-sided ideal of $R$, then $R/\mathfrak{m}$ doesn't have invariant basis number as well as $R$. Indeed, if $M$ is a finitely generated free left $R$-module, then $M/\mathfrak{m}M$ is a finitely generated free left $R/\mathfrak{m}$-module. If $R/\mathfrak{m}$ had invariant basis number, $R$ would as well.