KnowYourPhrase.com - The Meanings and History For Popular Idioms and Phrases | Use this handy list of phrases to search for more! 
Being in a desperate or bleak situation.
It's believed that the origins of this phrase come from boxing, where being on the ropes is considered a bad place to be. Why is that? Well, boxers typically fight in a boxing ring and along the edges of the ring are ropes. When a boxer is backed into a corner or is up against the ropes, their movement is severely restricted, which makes it more challenging to dodge incoming punches. 

Moreover, a boxer who is hit with a few heavy punches may be thrown off balance, and so to prevent themselves from falling over, they might try to grab onto the ropes. Hence, a boxer who is literally on the ropes is in a tough situation. It would seem, then, that this boxing term would later be used when referring to, not just boxers who are in a tough spot in the ring, but to anyone that is in a difficult situation.

The saying goes back to at least the year 1820, where it's written in Blackwood's Magazine. The phrase is used in an article about boxing, titled Boxiana, and it reads:

​    "At the close of one round, when Bill had got his adversary on the ropes, he went over him in a summerset, 
     in a way that we do not not remember to have seen practised either before or since."
* Tom was sick and with no food in the house to nourish himself, he was really on the ropes, that is, until he decided to drop by the grocery store for some canned soup.
Note: The origins for most idioms are unclear. Often times, the origins you see listed are plausible theories to how an idiom came to be, but not necessarily so. The quotes you see that contain the phrase are the oldest that I could find, but it's very possible there are older recordings somewhere, so if you know of any, let me know!

Keep in mind, just because you see a saying in a newspaper from 1850 does not mean it originated in that year, or from that newspaper. In all likelihood, if a saying is already being used in a form of media like that, it's probably from an earlier time. The purpose of these old quotes is to show, with proof, how old some phrases go back in history.

O-Letter Sayings  |
Meaning:
Origins:
Example Sentences:
Phrases and Idioms Starting with the Letter - O.
Phrases and Idioms

On The Ropes - The Meaning of This Phrase and its Origins