Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Getting undefined constant `RbConfig` when using --standalone on bundler 1.3 #2382

Closed
myronmarston opened this Issue · 4 comments

2 participants

@myronmarston

Travis recently upgraded their VMs to bundler 1.3. This is breaking our rspec builds because we use bundle install --standalone --binstubs to install our bundle and run things w/o bundler loaded at runtime (there's a history I won't go into here about why that matters for us). I've traced it back to this commit, where @hone added some code to the generated setup.rb file that references RbConfig. Problem is, you apparently have to require rbconfig before on some rubies:

➜  bundler git:(master) ✗ irb
1.8.7 :001 > RbConfig
NameError: uninitialized constant RbConfig
    from (irb):1
1.8.7 :002 > require 'rbconfig'
 => true 
1.8.7 :003 > RbConfig
 => Config 

...so we're suddenly getting lots of undefined constant errors on travis:

https://travis-ci.org/rspec/rspec-expectations/jobs/5400894/#L118

I think maybe you just need to add the require to fix it?

@indirect
Owner

you always have the craziest edge cases :) yeah, sounds like we just need to require it before it gets used.

@indirect
Owner

fixed, I hope

@indirect indirect closed this
@myronmarston

Thanks for addressing this issue so quickly!

@myronmarston

For anyone else running into this, I was able to work around the issue on travis by setting RUBYOPT:

export RUBYOPT='-rrbconfig'
@mvz mvz referenced this issue from a commit in mvz/rspec-core
@myronmarston myronmarston Fix travis CI build.
- Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after
  installing with `--standalone --binstubs`.
  bundler/bundler#2382
- The Travis VMs no longer have 32-bit JVMs available. Aruba 0.4.11
  forced the -d32 flag. 0.5 just documents it and makes a file available
  to require that will set it. We've updated Aruba here so that the jruby
  ENV vars aren't set automatically; we've kept the flag to disable JIT
  but removed -d32.
- Aruba now has a "the file xyz shoudl contain" step.
295b77a
@kchien kchien referenced this issue from a commit in kchien/rspec-expectations
@myronmarston myronmarston Fix travis CI build.
- Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after
  installing with `--standalone --binstubs`.
  bundler/bundler#2382
- The Travis VMs no longer have 32-bit JVMs available. Aruba 0.4.11
  forced the -d32 flag. 0.5 just documents it and makes a file available
  to require that will set it. We've updated Aruba here so that the jruby
  ENV vars aren't set automatically; we've kept the flag to disable JIT
  but removed -d32.
a68dfdc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.