@vercel/ruby 1.3.24 → 1.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +18 -26
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -8639,26 +8639,24 @@ async function matchPaths(configPatterns, workPath) {
8639
8639
  async function bundleInstall(bundlePath, bundleDir, gemfilePath) {
8640
8640
  build_utils_1.debug(`running "bundle install --deployment"...`);
8641
8641
  const bundleAppConfig = await build_utils_1.getWriteableDirectory();
8642
- try {
8643
- await execa_1.default(bundlePath, [
8644
- 'install',
8645
- '--deployment',
8646
- '--gemfile',
8647
- gemfilePath,
8648
- '--path',
8649
- bundleDir,
8650
- ], {
8651
- stdio: 'pipe',
8652
- env: {
8653
- BUNDLE_SILENCE_ROOT_WARNING: '1',
8654
- BUNDLE_APP_CONFIG: bundleAppConfig,
8655
- BUNDLE_JOBS: '4',
8656
- },
8657
- });
8642
+ const { exitCode, stderr, stdout } = await execa_1.default(bundlePath, ['install', '--deployment', '--gemfile', gemfilePath, '--path', bundleDir], {
8643
+ stdio: 'pipe',
8644
+ reject: false,
8645
+ env: {
8646
+ ...process.env,
8647
+ BUNDLE_SILENCE_ROOT_WARNING: '1',
8648
+ BUNDLE_APP_CONFIG: bundleAppConfig,
8649
+ BUNDLE_JOBS: '4',
8650
+ },
8651
+ });
8652
+ if (exitCode === 0 ||
8653
+ (exitCode === 18 && stderr.includes('Gemfile specified -1'))) {
8654
+ // Gemfile might contain "2.7.x" so install might exit with code 18 and message:
8655
+ // "Your Ruby patchlevel is 0, but your Gemfile specified -1"
8656
+ // See https://github.com/rubygems/bundler/blob/3f0638c6c8d340c2f2405ecb84eb3b39c433e36e/lib/bundler/errors.rb#L49
8658
8657
  }
8659
- catch (err) {
8660
- build_utils_1.debug(`failed to run "bundle install --deployment"...`);
8661
- throw err;
8658
+ else {
8659
+ throw new Error(`"bundle install" failed with exit code ${exitCode}: ${stdout}\n${stderr}`);
8662
8660
  }
8663
8661
  }
8664
8662
  exports.version = 3;
@@ -8711,13 +8709,7 @@ async function build({ workPath, files, entrypoint, config, meta = {}, }) {
8711
8709
  else {
8712
8710
  // try installing. this won't work if native extesions are required.
8713
8711
  // if that's the case, gems should be vendored locally before deploying.
8714
- try {
8715
- await bundleInstall(bundlerPath, bundleDir, gemfilePath);
8716
- }
8717
- catch (err) {
8718
- build_utils_1.debug('unable to build gems from Gemfile. vendor the gems locally with "bundle install --deployment" and retry.');
8719
- throw err;
8720
- }
8712
+ await bundleInstall(bundlerPath, bundleDir, gemfilePath);
8721
8713
  }
8722
8714
  }
8723
8715
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/ruby",
3
3
  "author": "Nathan Cahill <nathan@nathancahill.com>",
4
- "version": "1.3.24",
4
+ "version": "1.3.25",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index",
7
7
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -22,12 +22,12 @@
22
22
  "devDependencies": {
23
23
  "@types/fs-extra": "8.0.0",
24
24
  "@types/semver": "6.0.0",
25
- "@vercel/build-utils": "5.3.0",
25
+ "@vercel/build-utils": "5.3.1",
26
26
  "@vercel/ncc": "0.24.0",
27
27
  "execa": "2.0.4",
28
28
  "fs-extra": "^7.0.1",
29
29
  "semver": "6.1.1",
30
30
  "typescript": "4.3.4"
31
31
  },
32
- "gitHead": "47e3381c6df661168e8be335cc58df03f3cf2414"
32
+ "gitHead": "b52d01f809b80734ed1ab61df82f299f11a04720"
33
33
  }