Closed brigitlyons closed 7 years ago
Just to your last point, Homebrew will install the CLI tools automatically for you if they (or Xcode) aren't already installed, using the same mechanism that xcversion install-cli-tools
uses.
In practice I cannot confirm this. Homebrew causes a pop-up dialog that requires user interaction to complete the xcode cli tools installation. Perhaps I am missing something?
I guess for now I will just replicate https://github.com/KrauseFx/xcode-install/blob/master/lib/xcode/install/cli.rb#L16 in a separate script to first download the CLI tools
Interesting - Homebrew started doing this at least a few months ago, and what we've found is that as long as we're 1) already installing brew from scratch (whether interactively or autoamatically by tricking the prompt), and 2) no Xcode is currently "selected" (in other words, no CLI shim binaries like /usr/bin/git
work), then Homebrew installs the CLI tools silently.
If that doesn't help, this is AFAIK the original script that Brew and other tools derived their CLI installer mechanisms from: https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh
Updating Ruby version is not an acceptable workaround for our use case, especially since this used to work for Apple-provided Ruby as recently as xcversion 2.0.7.
The problem is that OpenSSL is bundled with your Ruby, and if it's an outdated version, it gets rejected by web servers. If you have an idea for an alternative solution, feel free to share it here 👍
@timsutton the steps you described that should cause Homebrew to install CLI tools silently were the ones I followed, but I was still getting the GUI prompt. /shrug
Current solution is to install Xcode CLI tools with xcversion install-cli-tools
(I initially thought this was also afflicted by the OpenSSL issue, but that's not the case), install homebrew, install rbenv via homebrew, install updated Ruby (2.3.1) via rbenv, and then use other xcversion commands. It's a bit more roundabout than our initial approach, but the end result is the same 😀
Thanks for the feedback, @timsutton and @KrauseFx !
I have already seen #175 and #179, along with the discussion over at fastlane: fastlane/fastlane#6553
Updating Ruby version is not an acceptable workaround for our use case, especially since this used to work for Apple-provided Ruby as recently as xcversion 2.0.7.
We are auto-configuring machines, so dependent on using xcversion to install the xcode command line tools without user interaction. Ultimately using rbenv to manage Ruby installs, and it's quite difficult to install rbenv using homebrew (or any other homebrew packages, for that matter) without having command line tools 😅