Dear roger123, let $R$ be a commutative ring and $M$ an $R$-module ( which I do not suppose finitely generated). In order to minimize the risk of misunderstandings, allow me to introduce the following terminology:
Locfree The module $M$ is locally free if for every $P \in Spec (R)$ there is an element $f \in Spec(R)$ such that $f \notin P$ and that $M_f$ is a free $R_f$ - module.
Punctfree The module $M$ is punctually free if for every $P \in Spec (R)$ the $R_{P} $ - module $M_P$ is free.
Fact 1 Every locally free module is punctually free. Clear.
Fact 2 Despite Wikipedia's claim, it is false that a punctually free module is locally free.
Fact 3 However if the punctually free $R$- module $M$ is also finitely presented, then it is indeed locally free.
Fact 4 A finitely generated module is locally free if and only it is projective.
Fact 5 A projective module over a local ring is free.This was proved by Kaplansky and is remarkable in that, let me repeat it, the module $M$ is not supposed to be finitely generated.
A family of counterexamples to support Fact 2 Let R be a Von Neumann regular ring. This means that every $r\in R$ can be written $r=r^2s$ for some $s\in R$. For example, every Boolean ring is Von Neumann regular. Take a non-principal ideal $I \subset R$. Then the $R$- module $R/I$ is finitely generated (by one generator: the class of 1 !), all its localizations are free but it is not locally free because it is not projective (cf. Fact 4) .The standard way of manufacturing that kind of examples is to take for R an infinite product of fields
$\prod \limits_{j \in J}K_j$ and for $I$ the set of families $(a_j)_{j\in J}$ with $a_j =0$ except for finitely many $j$ 's.
Final irony In the above section on counterexamples I claimed that the $R$ - module $R/I$ is not projective.This is because in all generality a quotient $R/I$ of a ring $R$ by an ideal $I$ can only be $R$ - projective if $I$ is principal . And I learned this fact in...Wikipedia !