Bug #2717

Requiring rubygems/specification causes tons of warnings for NoMethodError

Added by Sakuro OZAWA over 5 years ago. Updated almost 4 years ago.

[ruby-core:28086]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:ruby 1.9.2dev (2010-02-07 trunk 26607) [x86_64-darwin10.2.0] Backport:

Description

=begin
Strictly speaking this is a third party issue and already reported as
http://rubyforge.org/tracker/index.php?func=detail&aid=27087&group_id=126&atid=575
at 2009-09-10 but is still open with no response.

I'll post this so that other core developpers have chance to know the issue.

$ ruby -v -rrubygems/specification -e 1
ruby 1.9.2dev (2010-02-07 trunk 26607) [x86_64-darwin10.2.0]
/usr/local/lib/ruby/1.9.1/rubygems/source_index.rb:8: warning: loading in progress, circular require considered harmful - /usr/local/lib/ruby/1.9.1/rubygems/specification.rb
from ruby:0:in require'
from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:28:in
'
from /usr/local/lib/ruby/1.9.1/rubygems/specification.rb:1038:in <class:Specification>'
from <internal:gem_prelude>:273:in
const_missing'
from internal:gem_prelude:161:in load_full_rubygems_library'
from <internal:gem_prelude>:161:in
require'
from /usr/local/lib/ruby/1.9.1/rubygems.rb:1073:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems.rb:1073:in
require'
from /usr/local/lib/ruby/1.9.1/rubygems/source_index.rb:8:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/source_index.rb:8:in
require'
/usr/local/lib/ruby/1.9.1/rubygems/specification.rb:530: warning: instance variable @specification_version not initialized
WARNING: #' for nil:NilClass>
Gem::Specification.new do |s|
s.name = "minitest"
s.version = "1.5.0"
s.summary = "This minitest is bundled with Ruby"
end
WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/minitest.gemspec'
/usr/local/lib/ruby/1.9.1/rubygems/specification.rb:530: warning: instance variable @specification_version not initialized
WARNING: #' for nil:NilClass>
Gem::Specification.new do |s|
s.name = "rake"
s.version = "0.8.7"
s.summary = "This rake is bundled with Ruby"
end
WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/rake.gemspec'
/usr/local/lib/ruby/1.9.1/rubygems/specification.rb:530: warning: instance variable @specification_version not initialized
WARNING: #' for nil:NilClass>
Gem::Specification.new do |s|
s.name = "rdoc"
s.version = "2.2.2"
s.summary = "This rdoc is bundled with Ruby"
end
WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/rdoc.gemspec'
=end

History

#1 Updated by Sakuro OZAWA over 5 years ago

=begin
fyi, this is a clean install (configure && make && sudo make install) and rubygems-update 1.3.5 is not installed.

gem list

*** LOCAL GEMS ***

minitest (1.5.0)
rake (0.8.7)
rdoc (2.2.2)
=end

#2 Updated by Yui NARUSE over 5 years ago

  • Category set to lib
  • Status changed from Open to Assigned
  • Assignee set to Eric Hodel

=begin

=end

#3 Updated by Eric Hodel about 5 years ago

=begin
I'm not sure what to do about this yet.

gem_prelude.rb provides a fake rubygems.rb, but require 'rubygems/specification' does not cause the real rubygems.rb to be loaded.

This causes the errors.

The workaround is to assume that Gem::Specification is available, because require 'rubygems' provides it instead of requiring 'rubygem/specification'.
=end

#4 Updated by Yusuke Endoh almost 5 years ago

  • Assignee changed from Eric Hodel to Nobuyoshi Nakada

=begin
Hi,

Nobu, do you have any idea?

--
Yusuke Endoh mame@tsg.ne.jp
=end

#5 Updated by Yusuke Endoh almost 5 years ago

=begin
Hi, Nobu

Are you willing to handle this ticket?
If you are, are you willing to fix this issue?
If you are, will the fix be included in 1.9.2?

--
Yusuke Endoh mame@tsg.ne.jp
=end

#6 Updated by Yusuke Endoh almost 5 years ago

  • Target version set to 2.0.0

=begin
Hi,

I decide this issue as WONTFIX for 1.9.2.
As Eric said, do not require "rubygems/specfication" directly.

The workaround is to assume that Gem::Specification is available, because require 'rubygems' provides it instead of requiring 'rubygem/specification'.

This issue should be fixed in 1.9.3, by the approach of nobu's patch
in #3140.

--
Yusuke Endoh mame@tsg.ne.jp
=end

#7 Updated by Yui NARUSE over 4 years ago

=begin
What's going on?
=end

#8 Updated by Koichi Sasada almost 4 years ago

What's going on? again.

#9 Updated by Aaron Patterson almost 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This seems to be fixed in ruby trunk:

[aaron@higgins ~]$ ruby -v -rrubygems/specification -e' '
ruby 1.9.3dev (2011-06-06 trunk 31944) [x86_64-darwin10.7.0]
[aaron@higgins ~]$

Also available in: Atom PDF