GemInstaller 0.5.1 + RubyGems 1.3.5 + irb --> already initialized constant warnings
Reported by John Trupiano | July 23rd, 2009 @ 06:39 PM
I updated to RubyGems 1.3.5 today and started getting warnings spit out when running script/console on my rails apps. I have boiled the issue down to this simple irb example:
john-mbp:blah john$ irb
irb(main):001:0> require 'rubygems'
=> false irb(main):002:0> gem 'geminstaller'
=> true irb(main):003:0> require 'geminstaller'
/Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:12: warning:
already initialized constant RubyGemsVersion
/Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:17: warning:
already initialized constant VERSION => true
Comments and changes to this ticket
-
John Trupiano July 23rd, 2009 @ 06:41 PM
let's try that code block again
john-mbp:blah john$ irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> gem 'geminstaller' => true irb(main):003:0> require 'geminstaller' /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:12: warning: already initialized constant RubyGemsVersion /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:17: warning: already initialized constant VERSION => true
-
Chad Woolley July 24th, 2009 @ 01:48 AM
- State changed from new to resolved
I just released 0.5.2 which should fix this. Please let me know if you have any problems.
However, it is related to a bug in RubyGems:
http://rubyforge.org/tracker/index.php?func=detail&aid=26740&am...
-
John Trupiano July 24th, 2009 @ 04:29 AM
Hi Chad, thanks for the extremely quick response. Unfortunately 0.5.2 does not appear to have corrected the warning output for me:
john-mbp:trunk john$ irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> gem 'geminstaller', '= 0.5.2' => true irb(main):003:0> require 'geminstaller' /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:12: warning: already initialized constant RubyGemsVersion /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:17: warning: already initialized constant VERSION => true
fyi, gem env yields
john-mbp:trunk john$ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS:
- ruby - universal-darwin-9
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/john/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gems.rubyonrails.org"]
- REMOTE SOURCES:
- GEM PATHS:
-
Chad Woolley July 24th, 2009 @ 10:07 AM
- State changed from resolved to open
This isn't happening for me.
John, can you open the installed 0.5.2 Geminstaller gem, and look at the rubygems_version_checker class? See if it still tries to require 'rubygems/version_checker'. It should not.
Also, can you uninstall all old versions of geminstaller? Including any in other gem repos such as ~/.gem?
Thanks,
-- Chad -
John Trupiano July 24th, 2009 @ 01:21 PM
- rubygems_version_check.rb does not still try to require rubygems/version_checker
- Uninstalling all old versions of geminstaller does indeed fix the problem.
john-mbp:trunk john$ irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> gem 'geminstaller', '=0.5.2' => true irb(main):003:0> require 'geminstaller' => true
- Also, I went back and reinstalled 0.5.1 alongside 0.5.2 and it continues to omit the warning. In case you're curious, I previously had all of these versions installed when I was seeing the error:
Select gem to uninstall: 1. geminstaller-0.4.2 2. geminstaller-0.4.3 3. geminstaller-0.4.5 4. geminstaller-0.5.0 5. geminstaller-0.5.1 6. geminstaller-0.5.2 7. All versions
-
John Trupiano July 24th, 2009 @ 01:22 PM
In case it wasn't clear, I do not get the warnings with both 0.5.1 and 0.5.2 installed.
-
Chad Woolley July 24th, 2009 @ 01:41 PM
OK. That is strange, somehow you must have been picking up code from the old gem.
Also, can you do a favor for me and a couple of things for me (related to the rubygems bug linked above). You are another test case with the default leopard install, and I want to confirm that this bug exists on your system too. Please run the following commands on your system, and see if you find the same thing (that the rubygems/rubygems_version.rb file is still hanging around with an old version after the rubygems 1.3.5 upgrade):
$ cd /Library/Ruby/Site/1.8 $ pwd /Library/Ruby/Site/1.8 $ grep RubyGemsVersion rubygems.rb RubyGemsVersion = VERSION = '1.3.5' ... $ ls rubygems/rubygems_version.rb rubygems/rubygems_version.rb $ irb >> Gem::RubyGemsVersion => "1.3.5" >> require 'rubygems/rubygems_version' /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:12: warning: already initialized constant RubyGemsVersion /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:17: warning: already initialized constant VERSION => true >> Gem::RubyGemsVersion => "1.3.4"
Also, please confirm you upgraded to rubygems 1.3.5 with 'gem update --system'
Thanks,
-- Chad -
John Trupiano July 24th, 2009 @ 01:47 PM
As I'm sure you expected, I get the same results as you. And yes, I upgraded via 'gem update --system' ( http://twitter.com/jtrupiano/statuses/2798529501 ).
john-mbp:gitosis-admin john$ cd /Library/Ruby/Site/1.8 john-mbp:1.8 john$ pwd /Library/Ruby/Site/1.8 john-mbp:1.8 john$ grep RubyGemsVersion rubygems.rb 14: RubyGemsVersion = VERSION = '1.3.5' 196: RubyGemsPackageVersion = RubyGemsVersion john-mbp:1.8 john$ ls rubygems/rubygems_version.rb rubygems/rubygems_version.rb john-mbp:1.8 john$ irb irb(main):001:0> Gem::RubyGemsVersion => "1.3.5" irb(main):002:0> require 'rubygems/rubygems_version' /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:12: warning: already initialized constant RubyGemsVersion /Library/Ruby/Site/1.8/rubygems/rubygems_version.rb:17: warning: already initialized constant VERSION => true irb(main):003:0> Gem::RubyGemsVersion => "1.3.4"
-
Chad Woolley August 25th, 2009 @ 12:37 AM
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
GemInstaller
http://geminstaller.rubyforge.org