Skip to content

Commit ec7f727

Browse files
committed
Alternate idea: configure both cases without trying to auto-detect
1 parent a84b805 commit ec7f727

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

Scripts/BuildPhases/runRubyScript

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,10 @@
1313
# Inspiration: https://mgrebenets.github.io/xcode/2019/04/04/xcode-build-phases-and-environment
1414
#
1515

16-
if command -v rbenv; then
17-
echo "Configuring rbenv..."
18-
# Add `rbenv` ships to PATH
19-
export PATH="$HOME/.rbenv/shims:$PATH"
20-
# Check expected ruby version
21-
echo "Checking version..."
22-
rbenv version
23-
elif [[ -f "$HOME/.rvm/bin" ]]; then
24-
echo "Configuring rvm..."
25-
# Add `rvm` to PATH
26-
export PATH="$HOME/.rvm/bin:$PATH"
27-
# Load the expected Ruby version from `.ruby-version` — See https://rvm.io/rvm/basics#post-install-configuration
28-
RUBY_VERSION="$(cat .ruby-version)"
16+
# Add `rbenv` and `rvm` binaries to PATH, so that we support both
17+
export PATH="$HOME/.rbenv/shims:$HOME/.rvm/bin:$PATH"
18+
RUBY_VERSION="$(cat "${PROJECT_DIR}/../.ruby-version")"
19+
if command -v rvm; then
2920
source "$(rvm "${RUBY_VERSION}" do rvm env --path | tail -n1)"
3021
fi
3122

0 commit comments

Comments
 (0)