mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 04:22:04 +00:00
[ruby] Fix ruby version error message (#8381)
This error message was incorrectly telling user to use the `2.7.x` value even though it will fail `bundle install` with the following error: ``` Your Ruby patchlevel is 0, but your Gemfile specified -1 Command failed with exit code 18 (EXDEV) ``` The exact version, `2.7.0`, is necessary.
This commit is contained in:
@@ -5,13 +5,15 @@ import { Meta, NodeVersion, debug, NowBuildError } from '@vercel/build-utils';
|
||||
|
||||
interface RubyVersion extends NodeVersion {
|
||||
minor: number;
|
||||
patch: number;
|
||||
}
|
||||
|
||||
const allOptions: RubyVersion[] = [
|
||||
{ major: 2, minor: 7, range: '2.7.x', runtime: 'ruby2.7' },
|
||||
{ major: 2, minor: 7, patch: 0, range: '2.7.x', runtime: 'ruby2.7' },
|
||||
{
|
||||
major: 2,
|
||||
minor: 5,
|
||||
patch: 0,
|
||||
range: '2.5.x',
|
||||
runtime: 'ruby2.5',
|
||||
discontinueDate: new Date('2021-11-30'),
|
||||
@@ -55,7 +57,7 @@ function getRubyPath(meta: Meta, gemfileContents: string) {
|
||||
if (isDiscontinued(selection)) {
|
||||
const latest = getLatestRubyVersion();
|
||||
const intro = `Found \`Gemfile\` with discontinued Ruby version: \`${line}.\``;
|
||||
const hint = `Please set \`ruby "~> ${latest.range}"\` in your \`Gemfile\` to use Ruby ${latest.range}.`;
|
||||
const hint = `Please set \`ruby "~> ${latest.major}.${latest.minor}.${latest.patch}"\` in your \`Gemfile\` to use the latest Ruby version.`;
|
||||
throw new NowBuildError({
|
||||
code: 'RUBY_DISCONTINUED_VERSION',
|
||||
link: 'http://vercel.link/ruby-version',
|
||||
|
||||
Reference in New Issue
Block a user