Project

General

Profile

Actions

Bug #2717

closed

Requiring rubygems/specification causes tons of warnings for NoMethodError

Added by sakuro (Sakuro OZAWA) almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2010-02-07 trunk 26607) [x86_64-darwin10.2.0]
Backport:
[ruby-core:28086]

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 <top (required)>'
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: #<NoMethodError: undefined method >' 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: #<NoMethodError: undefined method >' 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: #<NoMethodError: undefined method `>' 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

Actions #1

Updated by sakuro (Sakuro OZAWA) almost 15 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

Actions #2

Updated by naruse (Yui NARUSE) almost 15 years ago

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

=begin

=end

Actions #3

Updated by drbrain (Eric Hodel) over 14 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

Actions #4

Updated by mame (Yusuke Endoh) over 14 years ago

  • Assignee changed from drbrain (Eric Hodel) to nobu (Nobuyoshi Nakada)

=begin
Hi,

Nobu, do you have any idea?

--
Yusuke Endoh
=end

Actions #5

Updated by mame (Yusuke Endoh) over 14 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
=end

Actions #6

Updated by mame (Yusuke Endoh) over 14 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
=end

Actions #7

Updated by naruse (Yui NARUSE) almost 14 years ago

=begin
What's going on?
=end

Updated by ko1 (Koichi Sasada) over 13 years ago

What's going on? again.

Updated by tenderlovemaking (Aaron Patterson) over 13 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 ~]$

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0