Pay the Big Bucks
If you're absolutely desperate to have a boy, you could try just shelling out $20,000. Scientists have discovered a way to ensure that you'll have a girl or boy through in vitro fertilization (IVF)—where the egg and sperm first meet in the laboratory, not your body. The procedure is a complex medical one that carries a hefty price tag and that couples generally only opt for when all other avenues to conception have been unsuccessfully attempted.
Many people consider this kind of sex selection to be immoral and unnatural and, indeed, some physicians will not test for the embryo's sex before implanting it. Then again, the moral issue is not a common one so far, as most couples can't afford this much green just to get the baby's nursery painted blue.
Adoption is another route where you can be assured of your child's sex. Barring these last two approaches, all you can do is try, hope that fate (er, make that biology) gives you what you want, and love the result regardless.