Because I keep forgetting how:
gem install gem<em>name --include-dependencies \ -p http://[user]:[pass]@[proxy</em>host]:[proxy_port]
You might also want to add additional gem sources. The normal command for this is gem sources -a [sourceurl] but the sources command unfortunately doesn't take a proxy parameter. You can directly add a source url to this line in gem/lib/rubygems/defaults.rb.
def self.default</em>sources %w[http://gems.rubyforge.org/] end
For example, I added github thus:
def self.default_sources %w[http://gems.rubyforge.org/ http://gems.github.com] end
This is of course horribly hacky. If you know of a better way, please tell me.