Correspondence between vector bundles and locally free sheaves I am trying to look at smooth manifolds in the context of locally ringed spaces. Vector bundles have a characterization in terms of sheaves of modules: if $X, \mathcal{O}_X$ is a topological (or smooth) manifold along with its structure sheaf, then a locally free $\mathcal{O}_X$ module of rank $n$ is the same thing as a vector bundle over $X$ of rank $n$. You can read about the correspondence in Ramanan chapter 2, for instance. 
Now forget about manifolds for a second, and suppose that $X, \mathcal{O}_X$ is just a locally ringed space, where all the stalks have residue field $\mathbb{R}$, and that $\mathcal{E}$ is a locally free $\mathcal{O}_X$ module, and suppose I try to form a vector bundle out of it, in the same way mentioned in the link above. 

My Question: Given a locally ringed space $X, \mathcal{O}_X$, where each stalk has residue field $\mathbb{R}$, and an $\mathcal{O}_X$ module
  $\mathcal{E}$ which is locally free of rank $n$, how can I construct a
  vector bundle from this information?

Here is my attempt, and you can see where I run into problems. 
Attempt 1: (Via a basis) I'm trying to define a topology, so I may as well work locally. After passing to a smaller open set, I can assume that $\mathcal{E}\cong (\mathcal{O}_X)^n$ as $\mathcal{O}_X$ modules. (Then later I should worry about transition functions and stuff, but you'll see I don't even get that far.)
As a set, my vector bundle $E$ will be the elements $\bigcup\limits_{x\in U} (\mathcal{E}_x/\mathfrak{m}_x\mathcal{E}_x)$, where $\mathfrak{m}_x \triangleleft \mathcal{O}_{X, x}$ is the maximal ideal. Now I topologize it by taking a basis for $\mathcal{E}$: suppose $\mathcal{E}(X)$ has a basis over $\mathcal{O}_X(X)$ given by $\mu^1, \dotsc, \mu^n$, and suppose I take as my basis for each $\mathcal{E}_x/\mathfrak{m}_x\mathcal{E}_x$ the images of $\mu^1_x, \dotsc, \mu^n_x \in \mathcal{E}_x$. Now I have specified a bijection  $a: U \times \mathbb{R}^n \to E$, and I can thereby put a topology on $E$, by declaring this to be a homeomorphism. (If I want to define a smooth structure on $E$, I can declare this to be a diffeomorphism.)
Is this topology the same if I select a different basis? If I choose $\nu^i$ as a basis, then $\nu^i = \sum_j f^{ij} \mu^j$ for $f^{ij} \in \mathcal{O}_X(U)$. I ask myself whether the map 
$$\mu_x \mapsto \sum_j \overline{f}^{ij}_x \mu_x$$
defines a self-homeomorphism from $E \to E$. (Here $\overline{f}^{ij}_x$ represents the image of $f^{ij}_x$ in $\mathcal{E}_x / \mathfrak{m}_x\mathcal{E}_x$.)
In the case where $X$ is a manifold, and $\mathcal{O}_X$ is its sheaf of continuous (smooth) real-valued functions, then the $f^{ij}$ really are continuous (smooth) real-valued functions on $X$, and the above map $E \to E$ seems pretty clearly to be continuous (smooth). But in the general case, where $X, \mathcal{O}_X$ is just a locally ringed space, I don't really know how to interpret the above map. (Why is it continuous on the topology I've defined? I can define values for $f^{ij}$ in each $\mathcal{O}_{X,x}/\mathfrak{m}_x$, but what do they really have to do with each other?)

What I suspect is going wrong: The spaces $\mathcal{E}_x/\mathfrak{m}_x \mathcal{E}_x$ at each point are all isomorphic to $\mathbb{R}^n$, but they don't have any canonical isomorphisms between them. To put a topology on $E$ I have to kind of decide on these canonical isomorphisms, and I can't just do it in any old way I want--the elements in the structure sheaf
  have to have something to do with continuous functions $X \to \mathbb{R}$ for this
  to work.

Attempt 2: (Basis free) (Suggested by a friend): (Edit: I don't think this works. As Eric Wofsey points out, the fibers would all be discrete.) Take $\mathcal{E}$, and form its etale space $\operatorname{Et}(\mathcal{E})$. The elements of the etale space are just all the germs. Let me describe a relation on germs by saying that two germs $\mu_x, \nu_x$ are related if they are in the same stalk and $\mu_x - \nu_x \in \mathfrak{m}_x\mathcal{E}_x$. Now just form the quotient topology by this relation.
If I do this in the case where $X, \mathcal{O}_X$ is a manifold with its ring of smooth functions, it seems to give me the correct topology on $X \times \mathbb{R}^n$. So perhaps it works as a basis-free construction?
Here are some related questions, but they don't really address my question: 1, 2, 3, 4.
 A: There's not going to be an associated vector bundle in general; you need your input data to have some connection to the topology on $\mathbb{R}$.  Whatever construction you make, to have any chance of being "correct", it should definitely be functorial with respect to isomorphisms.  But in the case $\mathcal{E}=\mathcal{O}_X$ (where the associated vector bundle should be just $X\times\mathbb{R}$), this says that for any unit $f\in\mathcal{O}_X(X)$, the induced map $X\to\mathbb{R}^\times$ obtained by taking the image of $f$ in each residue field should be continuous.  There is no reason to expect this to be true in general.  For instance, you can take $X=\mathbb{R}$ with the cofinite topology and the sheaf of $\mathbb{R}$-valued rational functions (i.e., $\mathcal{O}_X(U)$ is the ring of functions $U\to\mathbb{R}$ that are given by an element of $\mathbb{R}(x)$).  This is a locally ringed space with residue fields $\mathbb{R}$.  The function $x^2+1$ is a global unit, but the function $x\mapsto x^2+1$ is not continuous as a map from the cofinite topology to the usual topology.
I think the additional structure you need is not for the residue fields to all be $\mathbb{R}$ but a map of sheaves of rings $\mathcal{O}_X\to \underline{\mathbb{R}}$, where $\underline{\mathbb{R}}$ is the sheaf of continuous real-valued functions on $X$.  Then given any locally free $\mathcal{O}_X$-module, you can tensor it up to a locally free  $\underline{\mathbb{R}}$-module, which is easily seen to give a vector bundle via your first construction (since the functions $\bar{f}^{ij}_x$ will by definition be continuous).  Note that in particular, if the map $\mathcal{O}_X\to \underline{\mathbb{R}}$ is a map of sheaves of local rings (i.e. it maps the maximal ideal to the maximal ideal on each stalk), this gives a homomorphism from each residue field to $\mathbb{R}$.  However, as far as I can see you do not need to assume the map is local to be able to get vector bundles associated to locally free sheaves.
In the case where $X$ is a smooth manifold and $\mathcal{O}_X$ is the sheaf of smooth functions, this map $\mathcal{O}_X\to\underline{\mathbb{R}}$ is of course just the inclusion of the ring of smooth maps into the ring of continuous maps.
