Compare commits

..

2 Commits

Author SHA1 Message Date
Steven
5273279cf1 Publish Stable
- vercel@28.0.1
 - @vercel/ruby@1.3.26
2022-08-12 22:19:42 -04:00
Steven
37290039d6 [ruby] Fix bundle install (#8392)
This PR is a follow up to #8388. The tests were not running as expected because only the "vendored" test used `2.7.x` which was never failing `bundle install` to begin with. I had to add `2.7.x` to the non-vendored test to get `bundle install` to fail. The fix is to rename `2.7.x` to `2.7.0` before running `bundle install`.
2022-08-12 21:59:50 -04:00
4 changed files with 17 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.0.0",
"version": "28.0.1",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -49,7 +49,7 @@
"@vercel/python": "3.1.9",
"@vercel/redwood": "1.0.18",
"@vercel/remix": "1.0.19",
"@vercel/ruby": "1.3.25",
"@vercel/ruby": "1.3.26",
"@vercel/static-build": "1.0.18",
"update-notifier": "5.1.0"
},

View File

@@ -47,12 +47,22 @@ async function bundleInstall(
) {
debug(`running "bundle install --deployment"...`);
const bundleAppConfig = await getWriteableDirectory();
const { exitCode, stderr, stdout } = await execa(
const gemfileContent = await readFile(gemfilePath, 'utf8');
if (gemfileContent.includes('ruby "~> 2.7.x"')) {
// Gemfile contains "2.7.x" which will cause an error message:
// "Your Ruby patchlevel is 0, but your Gemfile specified -1"
// See https://github.com/rubygems/bundler/blob/3f0638c6c8d340c2f2405ecb84eb3b39c433e36e/lib/bundler/errors.rb#L49
// We must correct to the actual version in the build container.
await writeFile(
gemfilePath,
gemfileContent.replace('ruby "~> 2.7.x"', 'ruby "~> 2.7.0"')
);
}
await execa(
bundlePath,
['install', '--deployment', '--gemfile', gemfilePath, '--path', bundleDir],
{
stdio: 'pipe',
reject: false,
env: {
...process.env,
BUNDLE_SILENCE_ROOT_WARNING: '1',
@@ -61,19 +71,6 @@ async function bundleInstall(
},
}
);
if (
exitCode === 0 ||
(exitCode === 18 && stderr.includes('Gemfile specified -1'))
) {
// Gemfile might contain "2.7.x" so install might exit with code 18 and message:
// "Your Ruby patchlevel is 0, but your Gemfile specified -1"
// See https://github.com/rubygems/bundler/blob/3f0638c6c8d340c2f2405ecb84eb3b39c433e36e/lib/bundler/errors.rb#L49
} else {
throw new Error(
`"bundle install" failed with exit code ${exitCode}: ${stdout}\n${stderr}`
);
}
}
export const version = 3;

View File

@@ -1,7 +1,7 @@
{
"name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.3.25",
"version": "1.3.26",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",

View File

@@ -2,4 +2,6 @@
source "https://rubygems.org"
ruby "~> 2.7.x"
gem "cowsay", "~> 0.3.0"