Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

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

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

Comments

@myronmarston
Copy link
Contributor

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
Copy link
Member

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

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

fixed, I hope

@myronmarston
Copy link
Contributor Author

Thanks for addressing this issue so quickly!

@myronmarston
Copy link
Contributor Author

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

export RUBYOPT='-rrbconfig'

mvz pushed a commit to mvz/rspec-core that referenced this issue Jan 19, 2014
- Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after
  installing with `--standalone --binstubs`.
  rubygems/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.
kchien pushed a commit to kchien/rspec-expectations that referenced this issue Mar 7, 2014
- Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after
  installing with `--standalone --binstubs`.
  rubygems/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.
pat pushed a commit to pat/rspec-mocks that referenced this issue Jun 28, 2017
Fix travis CI build.

- Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after
  installing with `--standalone --binstubs`.
  rubygems/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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants