Mac upgrade ruby upgrade brew update
Mac upgrade ruby upgrade brew update
The Mac itself is version 2.x View ruby version number Open terminal ruby -v
- brew update
If you get an error, something is wrong with the brew update.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: RPC failed; curl 18 HTTP/2 stream 3 was reset
fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
fatal: early EOF
fatal: index-pack failed
error: Fetching /usr/local/Homebrew failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
This is a git error executed in terminal I read online that this is a git error so I went ahead and increased the size of the git according to the internet
git config http.postBuffer 204288000 (this size depends on your needs)
- Continuing to run brew update, I still get the same error as in step 1
git config --list to see if the above size was set successfully.
git clone git://mirrors.ustc.edu.co.uk/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
fatal: destination path '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core' already exists and is not an empty directory.
4 .cd "$(brew --repo)".
5.git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
mac@videozudabaoji Homebrew % cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core".
cool_mac@videozudabaoji homebrew-core % git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
brew update (it finally worked) All the commands in the image below
7 homebrew-core % brew -v and it's up to date!
- Continue with brew install ruby
Note that for mac 13 and above, the configuration is in one of these two files. If the bash_profile is configured, delete it.
If the bash_profile is configured, delete it
- echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"'. >> ~/.bash_profile
10.source ~/.bash_profile