When I was younger a friend of mines parents hooked up a metal barrel in between a tree laying sideways (wow hope you understood that) anyways they then placed a little rope that looped almost like your reins would to one end and then closest to that end that attached a thin piece of carpet.
Anyways, you get on and start of using two hands, then one hand, then no hands. It helps learn how to balance yours self and it also builds your leg and core muscles. The reason this works is because as your sitting on the barrel it is swinging in all different directions. We even attached another string to either side and would make it move for one another in odd ways, it was a lot of fun and easy teaching tool.
As far as work out stuff at the gym, almost anything that works your legs with help, but like I kind of mentioned before, working your core will help out too.
Good Luck :)
p.s. It is still up to this day and every now and then we give it a go for fun, and it kicked my butt not too long ago. :)