[Rubygems-developers] Testing against multiple rubygems versions, gem server problems

Chad Woolley thewoolleyman at gmail.com
Mon Dec 3 01:22:27 EST 2007


I'm trying to update my GemInstaller app's functional tests to pass
against rubygems 0.9.5.  I'm having problems getting an embedded test
gem server to run reliably under 0.9.4 and 0.9.5.

Previously, under 0.9.4, I did a full automated install of rubygems
0.9.4 to a temp dir, and used that dir as my test gem home as well.
The load path still used 0.9.4 rubygems libs from my system install
(/usr/local/lib/ruby/site_ruby/1.8/rubygems), but this was ok because
I only ran tests against 0.9.4.  I have a local dummy dir of various
stub gems which I run an embedded server against, and my tests use
GemInstaller to install these gems in various ways.

Now, I'm trying to use an environment var RUBYGEMS_VERSION= to
automatically put the appropriate embedded distro of rubygems onto my
load path, and run an embedded gem server and all of my tests ageinst
that specified version (either 0.9.4 or 0.9.5).

I can't make this work, however.  Gem server does strange things - it
will sometimes not show all gems, or sometimes it gets port conflict
errors even though there is no other server running, or it shows the
rubyforge gems instead of gems in my specified dir.  I even have
problems when I attempt to manually run the gem server with a
specified --port and --dir pointing to dummy gems, and then do a gem
list with --remote and --source=http://localhost:port.  This used to
work fine with 0.9.4, but now I get errors on 0.9.5 boxes, and
sometimes even on 0.9.4 boxes which used to work.  It also seems to
matter whether I use vs. localhost.

I've tried to debug this all weekend, but I keep getting lost in the
source_index and related gem list/query code.  It's also difficult
because I'm not sure how to reliably downgrade a rubygems installation
from 0.9.5 to 0.9.4.  Just installing 0.9.4 over 0.9.5 left stuff
broken. I could manually delete stuff and reinstall 0.9.4, but I'm
afraid I might miss something.

Has anyone tried to do anything like this?  Any tips or pointers on
how to debug these gem server problems more methodically are welcome.


More information about the Rubygems-developers mailing list