buildpacks-ruby icon indicating copy to clipboard operation
buildpacks-ruby copied to clipboard

Warn users when `.ruby-version` file is Ignored

Open lilacstella opened this issue 1 year ago • 0 comments

The current buildpack does not provide any warning or acknowledgement when there is a .ruby-version file in the root directory. Instead, it solely relies on the Ruby version specified in the Gemfile.lock. This behavior is intended but can lead to confusion and unexpected results, as users may assume the buildpack will use the Ruby version from the .ruby-version file.

To enhance the user experience and avoid potential issues, the buildpack should issue a warning when a .ruby-version file is detected but ignored. This warning should inform users that the buildpack will use the Ruby version specified in the Gemfile.lock and recommend updating the Gemfile.lock to match the desired Ruby version.

This warning should go well if coupled with #304 where the lack of a specified version is also added to a warning.

Actual behavior

Currently, the .ruby-version file is ignored and only the version specified in Gemfile.lock or a default will be chosen.

Expected outcome

When the buildpack detects a .ruby-version file in the root directory but ignores it in favor of the Ruby version specified in the Gemfile.lock, it should:

  • Detect the presence of the .ruby-version file.
  • Output a warning message informing the user that the .ruby-version file will be ignored.
  • Inform the user that the Ruby version specified in the Gemfile.lock will be used instead.
  • Recommend updating the Gemfile.lock to reflect the desired Ruby version to avoid any confusion or unexpected behavior.
  • (Optional) Not issue this warning if the current Ruby version being installed is already consistent with this file.

The warning message could go like this:

`.ruby-version` file detected but will be ignored. To avoid confusion or unexpected results, please specify the desired Ruby version in your `Gemfile.lock`.

lilacstella avatar Jul 17 '24 22:07 lilacstella