Skip to content

Commit 49fd848

Browse files
authored
Merge pull request #1129 from cloudfoundry/fix-ruby-version-compatibility
Fix Ruby version compatibility by always using buildpack Ruby
2 parents de6e09d + a17ea51 commit 49fd848

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bin/run

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ function main() {
9393
local phase
9494
phase="$(basename "${0}")"
9595

96-
if ! which ruby > /dev/null; then
97-
mkdir -p "${RUBY_DIR}"
96+
# Always install and use buildpack Ruby to ensure consistent version
97+
# regardless of system Ruby availability
98+
mkdir -p "${RUBY_DIR}"
9899

100+
if [ ! -d "${RUBY_DIR}/bin" ]; then
99101
util::install
100-
util::environment::setup
101102
fi
102103

104+
util::environment::setup
103105

104106
exec "${BUILDPACK_DIR}/bin/ruby-run" "${phase}" "${@-}"
105107
}

config/ruby.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515

1616
# Configuration for Ruby
17+
# Note: Ruby 3.2.8+ is required for Psych 5.0.1+ which supports YAML.load_file
18+
# with permitted_classes and aliases keyword arguments used throughout the buildpack
1719
---
1820
version: 3.2.+
1921
repository_root: https://raw.githubusercontent.com/cloudfoundry/ruby-buildpack/master/java-index

0 commit comments

Comments
 (0)