GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
for the line of rubies 1.8 rubygems did not load sysconfdir and defaulted back to /etc which lead to problems like this: https://gist.github.com/1981223
fix using sysconfdir for 1.8.x rubies
NOPE. Can't remove that Windows code. Just change the default "/etc" to RbConfig::CONFIG['sysconfdir'] || "/etc"
fix default windows path detection
@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)
to keep cross references https://bugs.ruby-lang.org/issues/6121
- Honor sysconfdir on 1.8. Fixes #291
$ 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>'
this might be because there is no explicit require "rbconfig" in the fix like it was in mine proposed code ...
@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