Let $X$ be a regular, irreducible projective scheme, of finite type over an arbitrary field $k$. Both Weil divisors and Cartier divisors are defined on $X$ and naturally correspond. If $k$ is algebraically closed (but of arbitrary characteristic), then we know (Hartshorne, Prop II.7.7) that global sections of $\mathcal{O}_X(D)$ correspond to effective divisors linearly equivalent to $D$. Is the same thing true for schemes such as $X$ above?
In particular, if $k=\bar{k}$ we can tell that $D$ is not effective if $\dim_k \Gamma (\mathcal{O}_X(D)) = 0$. In general, do we at least know that $D$ is linearly equivalent to an effective divisor iff $\dim_k \Gamma (\mathcal{O}_X(D)) \ne 0$?
It doesn't seem to be very hard to just repeat Hartshorne's proof to a more general setting, but I would also like to know what the most general versions of this correspondence are. For example, what if $X$ is only proper over $k$, or maybe over something like $\textrm{Spec } \mathbb{Z}[1/2]$. Is essentially the same thing true - or is it actually false? Any references will be very appreciated!