Gems built with (rubygems 1.5.0 / ruby 1.9.2) do not install properly with (1.5.0 / 1.8.7)

blambeau's Avatar

blambeau

03 Feb, 2011 09:41 AM

Below is a typical scenario, the problematic attribute seems to be autorequire, which is !!null in metadata.

% gem --version
1.5.0
% gem build foo.gemspec 
  Successfully built RubyGem
  Name: foo
  Version: 1.0.0
  File: foo-1.0.0.gem
% gem install foo-1.0.0.gem 
Foo successfully installed!
Successfully installed foo-1.0.0
1 gem installed
% rvm use 1.8.7
Using /Users/blambeau/.rvm/gems/ruby-1.8.7-p330
% gem --version
1.5.0
% gem install foo-1.0.0.gem 
ruby_code case not handled: YAML::PrivateType
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1069:in `ruby_code'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:782:in `to_ruby'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:776:in `each'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:776:in `to_ruby'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/installer.rb:232:in `write_spec'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/installer.rb:172:in `install'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:284:in `install'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:254:in `each'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:254:in `install'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:120:in `execute'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103:in `run'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:63:in `run'
/Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/bin/gem:25
ERROR:  While executing gem ... (Gem::Exception)
    ruby_code case not handled: YAML::PrivateType
  1. Support Staff 1 Posted by Luis Lavena on 03 Feb, 2011 01:50 PM

    Luis Lavena's Avatar

    Please provide the contents of foo.gemspec, as gemspec are serialized
    to YAML and adding something there that is not meant to be supported
    by Gem::Specification generates this error.

  2. 2 Posted by blambeau on 03 Feb, 2011 02:08 PM

    blambeau's Avatar

    I've tried to keep the simplest .gemspec that looks natural to me. It is in attachement.

    blambeau@yemana foo  % rvm use 1.9.2 && rm -rf pkg && gem build foo.gemspec 
    Using /Users/blambeau/.rvm/gems/ruby-1.9.2-p136
    WARNING:  no homepage specified
      Successfully built RubyGem
      Name: foo
      Version: 1.0.0
      File: foo-1.0.0.gem
    blambeau@yemana foo  % rvm use 1.8.7 && gem install foo-1.0.0.gem      
    Using /Users/blambeau/.rvm/gems/ruby-1.8.7-p330
    ruby_code case not handled: YAML::PrivateType
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1068:in `ruby_code'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:781:in `to_ruby'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:776:in `each'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/specification.rb:776:in `to_ruby'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/installer.rb:232:in `write_spec'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/installer.rb:172:in `install'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:284:in `install'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:254:in `each'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:254:in `install'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:120:in `execute'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103:in `run'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:63:in `run'
    /Users/blambeau/.rvm/rubies/ruby-1.8.7-p330/bin/gem:25
    ERROR:  While executing gem ... (Gem::Exception)
        ruby_code case not handled: YAML::PrivateType
    
  3. Support Staff 3 Posted by Luis Lavena on 03 Feb, 2011 02:22 PM

    Luis Lavena's Avatar

    Well, seems you're correct, it is clear that the metadata generated by 1.9.2 is not properly loaded by 1.8.7.

    I noticed the following differences:
    https://gist.github.com/809520

    But can't determine all the details.

  4. Support Staff 4 Posted by Luis Lavena on 03 Feb, 2011 02:25 PM

    Luis Lavena's Avatar

    Please report this to RubyGems bug tracker so the developers can keep track of it:

    http://rubyforge.org/tracker/?atid=575&group_id=126&func=br...

  5. 5 Posted by travis on 09 Feb, 2011 03:23 AM

    travis's Avatar

    It's also the other way around it looks like. Gems built with rubygems < 1.5.0 won't install with 1.5.0. It shows this error:

    ruby_code case not handled: Syck::PrivateType
    
  6. 6 Posted by travis on 09 Feb, 2011 06:58 AM

    travis's Avatar

    Actually, I'm getting issues all over the place now after upgrading to 1.5.0.

    Seeing this on one particular gem that is trying to update:

    ERROR:  While executing gem ... (ArgumentError)
    undefined class/module YAML::PrivateType undefined class/module YAML::PrivateType (ArgumentError)
    

    Bundler also fails with the same undefined class/module.

    
    C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:289:in `load': undefined class/module YAML::PrivateType (ArgumentError)
        from C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:289:in `_load'
        from C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:124:in `load'
        from C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:124:in `fetch_spec'
        from C:/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/remote_specification.rb:47:in `_remote_specification'
    
  7. 7 Posted by Kristian Mandru... on 09 Feb, 2011 01:47 PM

    Kristian Mandrup's Avatar

    I can't install any of my own gems since upgrading to Rubygems 1.5.0 :(

    gem install pkg/roles_generic-0.3.7.3.gem
    ERROR: While executing gem ... (ArgumentError)

    undefined class/module YAML::PrivateType
    

    And same using jeweler 1.5.2

    ** Execute install Executing "ruby -S gem install ./pkg/roles_generic-0.3.7.3.gem":
    ruby -S gem install ./pkg/roles_generic-0.3.7.3.gem
    ERROR: While executing gem ... (ArgumentError)

    rake aborted!
    Command failed with status (1): [ruby -S gem install ./pkg/roles_generic-0....]
    /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:995:in block in sh' /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1010:incall' /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1010:in sh' /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1094:insh' /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/jeweler-1.5.2/lib/jeweler/commands/install_gem.rb:14:in run' /Users/kristianconsult/.rvm/gems/ruby-1.9.2-p136/gems/jeweler-1.5.2/lib/jeweler.rb:92:ininstall_gem'

  8. Support Staff 8 Posted by Luis Lavena on 09 Feb, 2011 01:59 PM

    Luis Lavena's Avatar

    This has already been fixed in RubyGems, but still things need to be wrapped for 1.5.1 release:

    https://github.com/rubygems/rubygems/commit/6a896f356ef325d0357051f...

  9. Luis Lavena closed this discussion on 09 Feb, 2011 01:59 PM.

  10. travis re-opened this discussion on 09 Feb, 2011 07:07 PM

  11. 9 Posted by travis on 09 Feb, 2011 07:07 PM

    travis's Avatar

    Any idea what the timeframe is for a 1.5.1 release?

  12. Support Staff 10 Posted by Luis Lavena on 23 May, 2011 09:46 PM

    Luis Lavena's Avatar

    Hello travis,

    I believe RubyGems >= 1.6.x already provided the fixes you required.

    Please let us know if that is not the case, but I can mention that gems generated with RubyGems 1.8.x can be safely installed by RubyGems 1.3.5 inclusive.

    Going to close this in a few days if we don't hear from you.

    Thank you.

  13. 11 Posted by travis on 23 May, 2011 09:49 PM

    travis's Avatar

    Ya, haven't seen this recently.

  14. Support Staff 12 Posted by Luis Lavena on 24 May, 2011 02:26 PM

    Luis Lavena's Avatar

    Great, thank you. Closing this out.

  15. Luis Lavena closed this discussion on 24 May, 2011 02:26 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac