fix using sysconfdir for 1.8.x rubies #291

wants to merge 2 commits into


None yet
4 participants

mpapis commented Mar 7, 2012

for the line of rubies 1.8 rubygems did not load sysconfdir and defaulted back to /etc which lead to problems like this:

NOPE. Can't remove that Windows code. Just change the default "/etc" to RbConfig::CONFIG['sysconfdir'] || "/etc"


mpapis commented Mar 7, 2012

@djberg96 that would work via two exceptions, I have changed code to use first RbConfig::CONFIG['sysconfdir'] which should be the primary source of sysconfdir (at least for 1.8)

@evanphx evanphx closed this in c08a425 Mar 7, 2012


mpapis commented Mar 7, 2012

to keep cross references

jcast pushed a commit to jcasts/rubygems that referenced this pull request Mar 12, 2012

bearded commented Mar 18, 2012

$ git checkout origin/1.8 -b 1.8
Branch 1.8 set up to track remote branch 1.8 from origin.
Switched to a new branch '1.8'
$ ruby setup.rb 
RubyGems 1.8.18 installed

== 1.8.18 / 2012-03-11

* 4 bug fixes:

  * Use Psych API to emit more compatible YAML
  * Download and write inside `gem fetch` directly. Fixes #289
  * Honor sysconfdir on 1.8. Fixes #291
  * Search everywhere for a spec for `gem spec`. Fixes #288
  * Fix Gem.all_load_path. Fixes #171


RubyGems installed the following executables:
$ gem -v
/usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:71:in `rescue in rescue in <class:ConfigFile>': uninitialized constant Gem::ConfigFile::RbConfig (NameError)
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:53:in `rescue in <class:ConfigFile>'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:49:in `<class:ConfigFile>'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:28:in `<top (required)>'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:9:in `require'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:9:in `<top (required)>'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/bin/gem:9:in `require'
  from /usr/local/rvm/rubies/ruby-1.9.1-p431/bin/gem:9:in `<main>'

mpapis commented Mar 18, 2012

this might be because there is no explicit require "rbconfig" in the fix like it was in mine proposed code ...

bearded commented Mar 18, 2012

@mpapis, yes, require "rbconfig" solves this problem, and gem -v works on 1.8.7, 1.9.1, 1.9.2 and 1.9.3

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