Skip to content

Instantly share code, notes, and snippets.

@EtienneLem
Last active March 11, 2021 16:30
Show Gist options
  • Save EtienneLem/77146b7804cd764b8e09d89f44a5a451 to your computer and use it in GitHub Desktop.
Save EtienneLem/77146b7804cd764b8e09d89f44a5a451 to your computer and use it in GitHub Desktop.
Homebrew, CocoaPods & rbenv ARM64 / X86_64 configuration
# Homebrew
case $(uname -m) in
"arm64")
export PATH="/opt/homebrew/bin:$PATH"
export RBENV_ROOT="/opt/homebrew/opt/rbenv"
;;
"x86_64")
export PATH="/usr/local/bin:$PATH"
export RBENV_ROOT="~/.rbenv"
;;
esac
# rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"
@EtienneLem
Copy link
Author

At the time of this post, CocoaPods still isn’t compatible with arm64 (CocoaPods/CocoaPods#9907) and I figured a way to seamlessly have my terminal use the right brew / pod / rbenv based on the architecture.

I’m using iTerm as my main terminal (arm64) and have Terminal.app configured with Open using Rosetta (x86_64).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment