There are multiple ways to farm gems, which is probably the easiest way to get the achievements for freeing the prisoners, and for trading with other players.
1. The first way I learned to farm gems only works on console version (you also need 2 controllers), but allows you to get 200+ gems, along with about 25 yarn. To do this create a new profile on your Xbox 360 (don't make it on Live, you'll be deleting it in about 20-40 minutes anyway) and start the storyline. Skip the cutscenes and play through the first 2 chapters or so, trying for an A++ and the secret levels. Whatever you do in order for this to work properly, DO NOT SPEND THE GEMS OR YARN! Spending the resources will probably get you duplicate heads and weapons, so skipping over the gift shop is best. Next, after you finish the first 2 chapters, start the other controller and log in to your "good" account. go to the trading post and trade over as many gems as possible AND all the yarn your farm account collected. Delete the account and repeat. If you want you can
multiply the resources by creating multiple accounts and play on them with friends.