Skip to content

Rubygems broken due to psych problem for 1.7.16 in 1.8 mode #2057

@mislav

Description

@mislav

Script to reproduce that emulates what Rubygems' load_yaml does:

JRUBY_OPTS=--1.8 jruby -rubygems -e '
  begin
    gem "psych"
  rescue Gem::LoadError
  end
  begin
    require "psych"
  rescue LoadError
    warn $!.to_s
  end
'

Instead of a LoadError because psych isn't available on 1.8, we get:

Errno::ENOENT: No such file or directory - /opt/rubies/jruby-1.7.16/lib/ruby/gems/shared/gems/axiom-types-0.1.1/lib/psych
                      file? at org/jruby/RubyFileTest.java:131
  contains_requirable_file? at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/basic_specification.rb:46
                       any? at org/jruby/RubyEnumerable.java:1467
  contains_requirable_file? at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/basic_specification.rb:46
                       any? at org/jruby/RubyEnumerable.java:1467
  contains_requirable_file? at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/basic_specification.rb:44
      find_inactive_by_path at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:898
                       find at org/jruby/RubyEnumerable.java:592
      find_inactive_by_path at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:897
               try_activate at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems.rb:183
                    require at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:132
                  load_yaml at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems.rb:644
                  load_file at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/config_file.rb:327
                 initialize at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/config_file.rb:196
           do_configuration at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/gem_runner.rb:74
                        run at /opt/rubies/jruby-1.7.16/lib/ruby/shared/rubygems/gem_runner.rb:39
                     (root) at /opt/boxen/rbenv/versions/jruby-1.7.16/bin/jgem:21
                       load at org/jruby/RubyKernel.java:1076
                     (root) at /opt/boxen/rbenv/versions/jruby-1.7.16/bin/gem:4

This breaks the simplest of Rubygems operations on the command-line, such as:

JRUBY_OPTS=--1.8 gem env path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions