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

Closed
myronmarston opened this Issue Mar 11, 2013 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

myronmarston commented Mar 11, 2013

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?

Owner

indirect commented Mar 11, 2013

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

@indirect indirect added a commit that referenced this issue Mar 11, 2013

@indirect indirect require rbconfig, fixes #2382 f85a891
Owner

indirect commented Mar 11, 2013

fixed, I hope

indirect closed this Mar 11, 2013

Contributor

myronmarston commented Mar 11, 2013

Thanks for addressing this issue so quickly!

Contributor

myronmarston commented Mar 12, 2013

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

export RUBYOPT='-rrbconfig'

@mvz mvz pushed a commit to mvz/rspec-core that referenced this issue Jan 19, 2014

@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 pushed a commit to kchien/rspec-expectations that referenced this issue Mar 7, 2014

@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

@pat pat pushed a commit to pat/rspec-mocks that referenced this issue Jun 28, 2017

@myronmarston myronmarston Fix travis CI build.
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.
e7417e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment