There's lots of confusing information out there about using Ruby Gems to install gems when you're stuck behind a proxy.
This works for me, so hopefully it will for you too.
gem install <gemname> -p http://<username>:<password>@<proxy>:<port>
If you're running Windows and you get the following error:
ERROR: While executing gem ... (NoMethodError) undefined method `[]=’ for Gem::ConfigFile
then add the following method to ruby/site_ruby/1.8/rubygems/config_file.rb (make sure it's a public method)
def []=(key, value) @hash[key.to_s]=value end