$K_{0}(R) =\mathbb{Z}$ but some f.g. projective not stably free? This question is motived by this recent question.
$K_{0}(R)=\mathbb{Z}$ is often used as a euphemism for saying that every finitely generated projective module is stably free; however, there are some subtleties involved. 
The statement that every finitely generated projective module is stably free is equivalent to saying that $K_{0}(R)$ is generated by the isomorphism class of $R$. To show that the two are not the same, consider $R = M_{2}(\mathbb{C})$, $2\times 2$ matrices over the complex numbers. Devissage tells us that $K_{0}(R)=\mathbb{Z}$, with the unique simple module as a generator. However, every stably free projective has to have even length as an $R$ module, as length($R$)=2, and thus the unique simple module (projective as $R$ is semisimple) is not stably free.
Are there any commutative examples of this phenomena? More precisely, is there a commutative ring with $K_{0}(R)=\mathbb{Z}$, but with f.g. projectives which aren't stably free? A commutative noetherian one?      
 A: No. Since $K_0(R)=\mathbb{Z},$ the ring $R$ is not a direct product, i.e. $\operatorname{Spec} R$ is connected. Therefore, every projective module has constant rank.
The rank function is an isomomorphism between $K_0(R)$ and $\mathbb{Z}$ which maps the free module of rank 1 $R$ into the generator 1 of $\mathbb{Z}$. Therefore, every projective module is stably free.
In your noncommutative example, $M^{\oplus n}\simeq R,$ so the "rank" of $M$ isn't an integer.
A: Under the mild condition that the rank of a free module is an invariant, the free modules form a monoid isomorphic to $\mathbb N$. This induces an injection:
$$f: \mathbb Z \to K_0(R) $$ 
Then every projective is stably free is equivalent to $f$ being an isomorphism. 
When $R$ is commutative, $f$ splits (since one can map $R$ to a field, which induces a map $K_0(R) \to \mathbb Z$ such  that when compose to $f$ is the identity). So in this case $f$ is an isomorphism iff $K_0(R)\cong \mathbb Z$. It works whenever the map $f$ splits. 
In your example, $f$ is the injection $2\mathbb Z \to \mathbb Z$.  
A: When $R$ is commutative, $K_0(R)$ is a commutative ring with
multiplicative unit the class $[R]$ of $R$. The only ring structure
with additive group $\mathbb{Z}$ is the familiar one, so every element
of $K_0(R)$ is an integer multiple of $[R]$ - every finitely generated
projective $R$-module is stably free.
When $R$ is non-commutative, there is no natural ring structure on $K_0(R)$
which explains how Rishi's phenomenon occurs.
A: If $R$ is a commutative ring with $K_{0}(R)=\mathbb{Z}$, then $\mathop{\rm Spec} R$ is connected, because otherwise $R$ would split as a product, and $K_{0}(R)$ would contain a copy of $\mathbb{Z} \oplus \mathbb{Z}$. Hence there is a well defined surjective rank homomorphism $K_{0}(R) \to \mathbb{Z}$, which must then be an isomorphism. Since $R$ has rank 1, it follows that the class of $R$ generates. This implies that every projective module is stably free.
A: I'm going to disagree with all of the previous answers, and say that there is an example. This will relate to the issue of notation that I raise in my comment to Robin's answer.
Take $R = \mathbb{Z}/p^2$, for $p$ some prime. Every finitely generated $R$-module is a direct sum of modules of the form $\mathbb{Z}/p$ and $\mathbb{Z}/p^2$. From the short exact sequence $0 \to \mathbb{Z}/p \to \mathbb{Z}/p^2 \to \mathbb{Z}/p \to 0$, we get the relation $[\mathbb{Z}/p^2] = 2 [\mathbb{Z}/p]$ in $K_0(R)$. So $K_0(R)$ is generated by $[\mathbb{Z}/p]$. As length is an invariant on $K_0(R)$, there are no further relations. So $K_0(R) \cong \mathbb{Z}$, generated by $[\mathbb{Z}/p]$, and $\mathbb{Z}/p$ is not stably free.
There should be many similar examples whenever $R$ is not generically reduced.
