It may fail for noncommutative rings.
There are noncommutative rings (with identity) $R$ such that $R^2\cong R$. For example, let $k$ be a field, let $\mathbf{V}$ be an infinite dimensional vector space over $k$, and let $R$ be the ring of endomorphisms of $\mathbf{V}$. The fact that $\mathbf{V}\cong\mathbf{V}\oplus\mathbf{V}$ can be translated into a proof that $R^2\cong R$.
Since $R^2\cong R$, there is a $1\times 2$ matrix that corresponds to this isomorphism. For such a matrix $A$, $A\mathbf{x} = 0$ if and only if $\mathbf{x}=0$, since $A$ is an isomorphism.
For commutative rings, though, it works. Every commutative ring satisfies the strong rank condition, which is that for any $n\lt \infty$, any set of linearly independent elements in the right module $R^n$ has cardinality at most $n$. This is equivalent to saying that any homogeneous system of $n$ linear equations with $m$ unknowns and $m\gt n$ has a nontrivial solution.
The fact that commutative rings satisfy the strong rank condition is proven in T-Y Lam's Lectures on Rings and Modules, pp 14-15.
Lemma. Let $A$ and $B$ be right modules over $R$, where $B\neq 0$. If $A\oplus B$ can be embedded in $A$, then $A$ is not a noetherian module.
Proof. $A$ has a submodule $A_1\oplus B_1$ with $A_1\cong A$ and $B_1\cong B$. So $A\oplus B$ can be embedded in $A_1$, which therefore contans a submodule $A_2\cong B_2$ with $A_2\cong A$ and $B_2\cong B$. Continuing this way we get an infinite direct sum $B_1\oplus B_2\oplus\cdots$ in $A$, each $B_i\neq 0$, which shows that $A$ is not a noetherian module. QED
Theorem. Any right noetherian ring $R\neq 0$ satisfies the strong rank condition.
Proof. Let $R\neq 0$ be right noetherian. Then for any $n$, the free right module $A=R^n$ is noetherian, so if $B\neq 0$, then $A\oplus B$ cannot be embedded in $A$; in particular, for any $m\gt n$, $R^m=A\oplus R^{m-n}$ cannot be embedded in $A=R^n$. QED
Corollary. Any commutative ring $R\neq 0$ satisfies the strong rank condition.
Proof. Consider a system of $n$ linear equations in $m\gt n$ unknowns, with coefficients in $R$. Let $R_0$ be the subring of $R$ generated over $\mathbb{Z}\cdot 1$ by the coefficients $a_{ij}$. This is a nonzero noetherian ring by the Hilbert Basis Theorem, so the system of equations has a nontrivial solution over $R_0$, hence over $R$. Thus, $R$ has the strong rank condition. QED
Another nontrivial instance of rings with strong rank condition: if $R=A\times B$, then $R$ has the strong rank condition if and only if either $A$ or $B$ have the strong rank condition.