heroku / buildpacks-ruby

Heroku's Cloud Native Buildpack for Ruby applications.
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

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

Open lilacstella opened 3 months ago

lilacstella commented 3 months ago

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:

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`.