mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[ruby/rubygems] Add a missing "require 'etc'" statement:
- Ref https://github.com/ruby/rubygems/pull/9171#discussion_r2658056892 - Referencing the constant Etc may raise a `NameError` depending on whether other Rubygems/Bundler codepath have evaluated a prior "require 'etc'". This can be reproduced with this Gemfile: ```ruby source "https://rubygems.org" gem 'prism', github: "ruby/prism" ``` https://github.com/ruby/rubygems/commit/5d435e6863
This commit is contained in:
parent
b7dbdfe23a
commit
b722d37f21
@ -943,7 +943,12 @@ class Gem::Installer
|
||||
end
|
||||
|
||||
def build_jobs
|
||||
@build_jobs ||= Etc.nprocessors + 1
|
||||
@build_jobs ||= begin
|
||||
require "etc"
|
||||
Etc.nprocessors + 1
|
||||
rescue LoadError
|
||||
1
|
||||
end
|
||||
end
|
||||
|
||||
def rb_config
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user