Last active
April 22, 2021 06:07
-
-
Save caiguo37/d61954dc9a233b3639b5f66f2ae48152 to your computer and use it in GitHub Desktop.
ios_env.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if xcode-select --install 2>&1 | grep installed; then | |
echo command line tools installed.; | |
else | |
echo please install command line tools first. use *xcode-select --install* command; | |
exit 1 | |
fi | |
# Check for Homebrew, | |
# Install if we don't have it | |
if test ! $(which brew); then | |
echo "Installing homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
brew update --verbose | |
brew install rbenv rbenv-aliases rbenv-bundler ruby-build sha2 conan | |
env RUBY_BUILD_MIRROR_URL=https://cache.ruby-china.com/pub/ruby/2.6/ruby-2.6.3.tar.bz2# rbenv install 2.6.3 | |
rbenv global 2.6.3 | |
LINE='eval "$(rbenv init -)"' | |
eval $LINE | |
grep -q "$LINE" ~/.zshrc || echo "$LINE" >> ~/.zshrc | |
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ | |
gem update --system | |
gem install bundler --verbose | |
bundle config mirror.https://rubygems.org https://gems.ruby-china.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment