Skip to content

Commit

Permalink
Merge pull request #16964 from Bo98/ruby-stdin-fix
Browse files Browse the repository at this point in the history
Fix setup-ruby/rubocop issues when euid != uid
  • Loading branch information
MikeMcQuaid committed Mar 28, 2024
2 parents 821f67f + 2f05b47 commit 0f73226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Library/Homebrew/cmd/setup-ruby.sh
Expand Up @@ -17,7 +17,8 @@ homebrew-setup-ruby() {
return
fi

GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" /dev/stdin <<<'require "rbconfig"; puts RbConfig::CONFIG["ruby_version"]')"
echo "${GEM_VERSION}"
GEM_HOME="${HOMEBREW_LIBRARY}/Homebrew/vendor/bundle/ruby/${GEM_VERSION}"
BUNDLE_GEMFILE="${HOMEBREW_LIBRARY}/Homebrew/Gemfile"

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/rubocop.sh
Expand Up @@ -11,7 +11,7 @@ homebrew-rubocop() {
source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh"
setup-ruby-path

GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" /dev/stdin <<<'require "rbconfig"; puts RbConfig::CONFIG["ruby_version"]')"
GEM_HOME="${HOMEBREW_LIBRARY}/Homebrew/vendor/bundle/ruby/${GEM_VERSION}"
BUNDLE_GEMFILE="${HOMEBREW_LIBRARY}/Homebrew/Gemfile"
BUNDLE_WITH="style"
Expand Down

0 comments on commit 0f73226

Please sign in to comment.