[Rubygems-developers] Problems trying to use self-contained rubygems installation

Chad Woolley thewoolleyman at gmail.com
Thu Feb 22 06:11:09 EST 2007


Hi,

I'm trying to use a completely self-contained rubygems installation,
for testing purposes.

The problem is that when I attempt to install to this location, the
first gem install fails, but the second one works.  Here's what I'm
doing (backtrace and debug omitted for brevity):

Step 1 - Create the rubygems installation:

chadmac:~/install/ruby/rubygems-0.9.2 woolley$ rm -rf /tmp/myrubygems
&& export GEM_HOME=/tmp/myrubygems && ruby setup.rb config
--prefix=/tmp/myrubygems && ruby setup.rb setup && ruby setup.rb
install
...
...bunch of output then it is installed in /tmp/myrubygems


Step 2 - Set up custom config file:

chadmac:/tmp woolley$ cat ~/test_gem.rc
gempath:
  - /tmp/myrubygems
gemhome: /tmp/myrubygems


Step 3 - Attempt a gem install - fails first time:

chadmac:/tmp woolley$ gem install ruby-doom --config-file ~/test_gem.rc
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find ruby-doom (> 0) in any repository

Step 4 - Run exact same install command, works second time:

chadmac:/tmp woolley$ gem install ruby-doom --config-file ~/test_gem.rc
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed ruby-doom-0.8


I suspect this is related to the source_cache file, since it is not
created by the original setup, and it contains data after the second
successful install.  However, even if I touch and create it after the
setup, it is still empty after the first failed install.

Also, I notice the problem does not occur if I do a "gem update
--config-file ~/test_gem.rc" immediately after setup.

Any idea why this happens?  Am I doing something wrong or is this a
bug?  Is there any way I can work around it other than doing gem
update after setup?

Thanks,
Chad


More information about the Rubygems-developers mailing list