What is the rigorous definition of the ratio of two numbers? I have tried learning about ratios and proportions from a couple of books, but I have problems with the approaches they take.
First of all, a definition is never actually given. Examples are given concerning only natural numbers. For example one definition I encountered was the ratio of object $x$ to object $y$ is $m:n$ if for every $m$ $x's$ there are $n$ $ y's$. Good enough but what about rational and real numbers ?
Secondly, if a ratio is supposed to be a relation between two quantities (which it is defined vaguely in many books) then why is it treated as a number, for example saying things like the ratio of a to b is greater than that of c to d and so on.
So the question is: 

What is a definition of the ratio between two real numbers $a$ and $b$. Is it fair to say that $a$ and $b$ have ratio $m:n$ if $\frac{a}{m} = \frac{b}{n}$, for example?

 A: Your concerns are very much the same as the concerns of the ancient Greeks in the 4th century BC. Their solution is summarized in books 5 to 10 of Euclid's Elements, written about 300 BC in Alexandria, Egypt. Euclid's Elements.
It's really a deeply philosophical thing to ask whether a ratio is in fact a number. The solution in textbooks is to call an equivalence class of ratios a rational number. But that's really a cop-out. It doesn't say what the rational number really is. It's really one of those regularly perplexing things in mathematics. You start with some system which seems really "real", and then you construct something else from it, like the real numbers, the complex numbers, negative numbers, and so forth. But the concepts of mathematics keep getting more and more abstract. Another example is tensors, which have many definitions, all of them unsatisfactory, including equivalence classes (i.e. quotient spaces). But if you go back to the integers, if you look closely enough, you'll see that they're not really well defined either. They're just less difficult to accept than the "higher" number concepts.
And concerning the integers, around about 100 to 120 years ago, people were defining integers to be equivalence classes too. E.g. the number 3 is the equivalence class of all sets which contain 3 objects. That's pretty crazy, but a lot of books still use this definition of cardinality. My point is that even the integers are not above suspicion.
A: I don't know if this explanation will be sufficient for your purposes, but at a high level, a ratio $a/b$ is simply the product of $a$ and the multiplicative inverse of $b$. 
Is that too abstract? I think that part of the problem here is that a "ratio" is rarely a well-formalized mathematical object: we use ratios in everyday discourse to describe relationships between two things using a rational number, but I rarely see the idea of a ratio mentioned formally in mathematics. I wouldn't overthink ratios -- you're fundamentally looking at arithmetic.
A: Definition
Let a and b be the non-zero numerical values of two similar quantities. Then these quantities are said to be in the ratio r:R where r and R are positive real numbers iff there exists a real number x such that a=xr and b=xR.
Illustrative Example
Let masses of two persons A and B be 40 kg and 36 Kg respectively. Then their masses are in the ratio 10 : 9 since 40=4×10 and 36=4×9.
Remark 1:
It immediately follows from this definition that given the values a and b for two similar quantities, the ratio determined by the values a and b is not unique. But this definition works fine for all practical purposes.
Remark 2
Since ratio is essentially used for comparing two similar quantities the following theorem lends intuitive meaning to our definition of ratio.
Theorem
Let the non-zero numerical values, a and b, of two similar quantities be in the ratio r:R. Then, a is r ⁄ R times of b, i.e.  ,  a=r/R x b.
Proof
Since a and b are in the ratio r:R hence a=xr and b=xR for some real number x. Now,
           r / R  x b = (r / R).(xR) = xr = a.                 Q.E.D.

Illustrative Example
The ratio of trees to shrubs in my garden is 7:4. How many shrubs are there for 21 trees?
Solution
The ratio of shrubs to trees is 4:7. So shrubs are 4/7 times the trees. Hence,
the number of shrubs =4/7  ×21=12.
