@vercel/ruby 1.3.23 → 1.3.26

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 -28
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -8639,27 +8639,23 @@ 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
- });
8658
- }
8659
- catch (err) {
8660
- build_utils_1.debug(`failed to run "bundle install --deployment"...`);
8661
- throw err;
8662
- }
8642
+ const gemfileContent = await fs_extra_1.readFile(gemfilePath, 'utf8');
8643
+ if (gemfileContent.includes('ruby "~> 2.7.x"')) {
8644
+ // Gemfile contains "2.7.x" which will cause an error message:
8645
+ // "Your Ruby patchlevel is 0, but your Gemfile specified -1"
8646
+ // See https://github.com/rubygems/bundler/blob/3f0638c6c8d340c2f2405ecb84eb3b39c433e36e/lib/bundler/errors.rb#L49
8647
+ // We must correct to the actual version in the build container.
8648
+ await fs_extra_1.writeFile(gemfilePath, gemfileContent.replace('ruby "~> 2.7.x"', 'ruby "~> 2.7.0"'));
8649
+ }
8650
+ await execa_1.default(bundlePath, ['install', '--deployment', '--gemfile', gemfilePath, '--path', bundleDir], {
8651
+ stdio: 'pipe',
8652
+ env: {
8653
+ ...process.env,
8654
+ BUNDLE_SILENCE_ROOT_WARNING: '1',
8655
+ BUNDLE_APP_CONFIG: bundleAppConfig,
8656
+ BUNDLE_JOBS: '4',
8657
+ },
8658
+ });
8663
8659
  }
8664
8660
  exports.version = 3;
8665
8661
  async function build({ workPath, files, entrypoint, config, meta = {}, }) {
@@ -8711,13 +8707,7 @@ async function build({ workPath, files, entrypoint, config, meta = {}, }) {
8711
8707
  else {
8712
8708
  // try installing. this won't work if native extesions are required.
8713
8709
  // 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
- }
8710
+ await bundleInstall(bundlerPath, bundleDir, gemfilePath);
8721
8711
  }
8722
8712
  }
8723
8713
  }
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.23",
4
+ "version": "1.3.26",
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.2.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": "32afd67d29d46f67027091ab9695d8ff330355b5"
32
+ "gitHead": "5273279cf1ead46a1cc864850e67c2a4c2f485f7"
33
33
  }