Let $X$ be a scheme and let $\mathscr{I} \subset \mathscr{O}_X$ be a quasi-coherent sheaf of ideals. Suppose that for each $x \in X$, the stalk $\mathscr{I}_x$ is generated by an element $f_x \in \mathscr{O}_x$ that comes from a nonzero divisor $f \in \Gamma(U, \mathscr{O}_X)$ for some affine open neighborhood $U$ of $x$ (so $f_x$ is a nonzero divisor, too). Then each $\mathscr{I}_x$ is a free $\mathscr{O}_x$-module of rank $1$. Is $\mathscr{I}$ necessarily locally free of rank $1$?

The answer is surely 'yes' if $X$ is Noetherian (e.g., by http://stacks.math.columbia.edu/tag/0AG8), but a positive answer is claimed in general in the last paragraph on p. 212 of the book "Neron models". Is there a counterexample to this claim?

Commutative Algebra, chap. II, § 5, exercise 7. As indicated in the previous comment, the answer is also 'yes' with no noetherian hypothesis if $\mathscr{I}$ is finitely presented (loc. cit., Proposition 2). $\endgroup$ – abx Dec 29 '14 at 6:58