()
| 50 | } |
| 51 | |
| 52 | function resolveSystemRuby(): { |
| 53 | rubyPath: string; |
| 54 | gemPath: string; |
| 55 | major: number; |
| 56 | minor: number; |
| 57 | } | null { |
| 58 | const rubyPath = which.sync('ruby', { nothrow: true }) as string | null; |
| 59 | const gemPath = which.sync('gem', { nothrow: true }) as string | null; |
| 60 | if (!rubyPath || !gemPath) return null; |
| 61 | const ver = spawnSync(rubyPath, ['-e', 'print RUBY_VERSION'], { |
| 62 | encoding: 'utf8', |
| 63 | }); |
| 64 | if (ver.status !== 0 || !ver.stdout) return null; |
| 65 | const [mj, mn] = String(ver.stdout).trim().split('.'); |
| 66 | const major = Number(mj) ?? 3; |
| 67 | const minor = Number(mn) ?? 3; |
| 68 | return { rubyPath, gemPath, major, minor }; |
| 69 | } |
| 70 | |
| 71 | function makeLocalRubyEnv({ |
| 72 | major, |
no test coverage detected