Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "uninitialized constant Gem::Requirement" from Bundler in 9K #2557

Open
iconara opened this issue Feb 4, 2015 · 1 comment
Open

Comments

@iconara
Copy link
Contributor

iconara commented Feb 4, 2015

This could be a Bundler issue, but since it works fine in JRuby 1.7 and not in 9K I will report it here first.

When I run bundle install in JRuby 9K I often get this error (printed in yellow):

NameError: uninitialized constant Gem::Requirement

followed at the end by an error (printed in red) that says that one of the gems couldn't be installed.

It looks like it's only happening when Bundler is doing parallel installs (it happens with --jobs=2 but not with --jobs=1), so it looks to me like there's something that has changed around constant definitions and concurrency.

Running with -Xlog.backtraces=true -Xlog.exceptions-true I can see this error being raised:

2015-02-04T09:37:09.746+01:00: TraceType: Exception raised: NameError : uninitialized constant Gem::Requirement
2015-02-04T09:37:09.747+01:00: TraceType: Backtrace generated:
2015-02-04T09:37:09.747+01:00: TraceType:   org/jruby/RubyModule.java:2935 in const_missing
2015-02-04T09:37:09.747+01:00: TraceType:   /Users/theo/.rvm/rubies/jruby-head/lib/ruby/stdlib/rubygems/dependency.rb:58 in __script__
2015-02-04T09:37:09.747+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/lockfile_parser.rb:145 in __script__
2015-02-04T09:37:09.747+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/lockfile_parser.rb:98 in __script__
2015-02-04T09:37:09.747+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/lockfile_parser.rb:45 in initialize
2015-02-04T09:37:09.747+01:00: TraceType:   org/jruby/RubyArray.java:1569 in each
2015-02-04T09:37:09.747+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/lockfile_parser.rb:39 in initialize
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler.rb:163 in locked_gems
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/source.rb:24 in version_message
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/source/rubygems.rb:80 in install
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/installer.rb:104 in install_gem_from_spec
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/rubygems_integration.rb:162 in with_build_args
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/installer.rb:103 in install_gem_from_spec
2015-02-04T09:37:09.776+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/installer.rb:282 in install_in_parallel
2015-02-04T09:37:09.784+01:00: TraceType:   org/jruby/RubyProc.java:289 in call
2015-02-04T09:37:09.784+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/parallel_workers/thread_worker.rb:19 in prepare_workers
2015-02-04T09:37:09.784+01:00: TraceType:   org/jruby/RubyKernel.java:1310 in loop
2015-02-04T09:37:09.784+01:00: TraceType:   /Users/theo/.rvm/gems/jruby-head@global/gems/bundler-1.7.12/lib/bundler/parallel_workers/thread_worker.rb:15 in prepare_workers
@mlee
Copy link

mlee commented Aug 25, 2016

I ran into a (somewhat) similar issue with JRuby 9.1.2.0 and Bundler 1.12.5. bundle install would fail intermittently with the following error message:

NameError: uninitialized constant Jars::Installer
An error occurred while installing minitest (5.9.0), and Bundler cannot
continue.
Make sure that `gem install minitest -v '5.9.0'` succeeds before bundling.

Passing --jobs=2 to bundle install seemed to resolve the issue (previously I was running bundle install with no additional flags).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants