Bugs item #27087, was opened at 2009-09-10 20:34
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27087&group_id=126

Category: #gem and #require methods
Group: None
Status: Open
Resolution: None
Priority: 1
Submitted By: Rob Sanheim (rsanheim)
Assigned to: Eric Hodel (drbrain)
Summary: Rubygems 1.3.5 and Ruby 1.9 breaks hard after require 
'rubygems/specification'

Initial Comment:
Please see the repo:

http://github.com/rsanheim/ruby19_rubygems_bug/tree/master

The build is here:

http://runcoderun.com/rsanheim/ruby19_rubygems_bug

The failing build on Ruby 1.9.1 p243:

http://runcoderun.com/rsanheim/ruby19_rubygems_bug

http://runcoderun.com/rsanheim/ruby19_rubygems_bug/builds/09a9f683fe7848980e10ac7bd2291040ec11ea17/1/ruby_191

Here is the simplest code to illustrate:

  require 'hoe'
  gem 'hoe' # these should work

  puts "about to break 'gem'"  
  require 'rubygems/specification'
  gem 'hoe' # exception thrown here when it shouldn't be


----------------------------------------------------------------------

Comment By: Hedge Hog (hedgehog)
Date: 2010-05-09 08:23

Message:
OK, disregard last comment. Some other gems need to be installed.

Recommended workaround is as mentioned before:
Remove require 'rubygems/specification'

So far I have not seen any adverse side effects.

----------------------------------------------------------------------

Comment By: Hedge Hog (hedgehog)
Date: 2010-05-09 04:23

Message:
Why I'm not yet sure but it is called after rake/gempackagetask.  Specifically:

require 'rubygems'
require 'rake/gempackagetask'
require 'rubygems/specification'

If I comment out the 
require 'rubygems/specification'

I still get a failure:

http://www.pastie.org/952149

I'm yet to get my head around how/why Chef has to use this sequence.... they 
may not be alone.

It is still a useful example of a reproducible case that is minimal:

$ gem list --local

*** LOCAL GEMS ***

rake (0.8.7)
rdoc (2.5.8)

HTH?


----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 2010-05-04 20:26

Message:
Why are you requiring rubygems/specification?

require 'rubygems' provides it for you.

----------------------------------------------------------------------

Comment By: Hedge Hog (hedgehog)
Date: 2010-05-04 05:49

Message:
The following is a minimal rvm example, the `rake -T` command triggers the 
issue here too:

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

cat >~/.bash_profile <<EOT
source ~/.bashrc
export LC_ALL=en_US.utf8
export LANGUAGE=en_US.utf8
export LANG=en_US.utf8
if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
EOT

source ~/.bash_profile
rvm install 1.9.1 

pushd ~/src
git clone git://github.com/opscode/mixlib-authentication.git
pushd mixlib-authentication
rake -T 2>&1|tee /tmp/rake-t-error.log
popd
popd


The rake log is here:
http://www.pastie.org/944745

HTH?


gem list --local

*** LOCAL GEMS ***

rake (0.8.7)
rdoc (2.5.8)



----------------------------------------------------------------------

Comment By: Hedge Hog (hedgehog)
Date: 2010-05-04 04:39

Message:
Also affects:
    
    ruby 1.9.2dev (2009-07-18 trunk 24186) [x86_64-linux]

----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 2010-04-22 03:54

Message:
I'm not entirely sure how this is breaking, but require 'rubygems' provides 
Gem::Specification, so you don't need to require it.  The workaround is to not 
require 'rubygems/specification'.

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2009-09-11 07:30

Message:
We've already tracked down the problem. The workaround as described is to 
remove your manually installed rubygems from 1.9.x. 

----------------------------------------------------------------------

Comment By: Adam Salter (aqsalter)
Date: 2009-09-11 06:33

Message:
Ryan: Sorry about that. I (too) am working on several projects, busy and wanted 
to throw in my helpful comments... I find problems can get fixed quicker if the 
devs know how many people are affected.

I misunderstood your initial comment: 

'0 failures out of 4' sounds like no failures, which could certainly be assumed 
to be a good thing - except we are trying to track down a problem.

+1 biting off a much ruder comment and looking to the future with hope and 
optimism.


----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2009-09-11 06:08

Message:
Please don't +1. That shit is obnoxious.

We don't need to test this against jeweler if we have a much cleaner smaller 
repro that is standalone.

----------------------------------------------------------------------

Comment By: Adam Salter (aqsalter)
Date: 2009-09-11 01:47

Message:
+1 please fix... Not exactly 'urgent' but annoying.

I raised a bug on the 'jeweler' gem because of this:

http://github.com/technicalpickles/jeweler/issues#issue/34

I'm sure that the code i provide there:

Rakefile: require 'jeweler'

rake -T

will trigger issue.

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2009-09-10 20:54

Message:
Huh!

% sudo gem uninstall rubygems-update
% multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'
...
TOTAL RESULT = 0 failures out of 4

Passed: 1.9.1-p129, 1.8.7-p72, 1.8.7-p160, 1.8.6-p368


----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2009-09-10 20:53

Message:
Easier repro of the warnings:

multiruby -rubygems -rrubygems/specification -e 0

and:

multiruby -rubygems -rrubygems/specification -e 'gem "hoe"'


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27087&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to