RubyGems through a proxy with authentication

Sometimes you run into trouble when using bleeding edge stuff.  Ruby, Ruby on Rails, RubyGems… it seems like all of these technologies are changing so damned much that calling it ‘bleeding edge’ just isn’t nearly enough.  And there’s big differences in versions, so you just gotta stay on top of it.

That’s an arguable point, I know.  Lots of people just don’t update until it’s all stable.  Me, I like to live dangerously.  And it inevitably lands me in heaps of headache inducing trouble.  Fortunately, there’s no shortage of smart people out there. 

Hennywayz.  I tried to use RubyGems from behind the Moto proxy/firewall, and it failed miserably.  I used the recommended syntax for RubyGems behind a proxy, but nothing.  Just errors.  Then I ran into this guy’s website, where he describes a patch to use RubyGems from behind a proxy with authentication.  He suggests a patch to RubyGems (it’s easy, not scary, and if you’re scared of making this little patch then you ought to be considering a different career path… just sayin’…) that is heretofore undocumented, and unimplemented in RubyGems.  It works like magic.  Once you’ve patched ‘er up, run the command:

gem update rails –include-dependencies -p http://username:password@proxy_url:port

Replace the variables with your own, of course.  And voila.  Magical.  Now, why the heck isn’t that little snippet of code in RubyGems, I wonder?

Gems has been causing me endless headaches since I got back on the RoR wagon.  My Powerbook has been steadfastly rejecting all solutions ever since I updated to the most recent version of Ruby, Rails, and Gems.  Annoying?  More than a little bit.

This site uses Akismet to reduce spam. Learn how your comment data is processed.