安装Homebrew
可以去官网查看命令
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
此过程需要输入密码,详情打印如下:
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
==> Installing Command Line Tools (macOS Mojave version 10.14) for Xcode-10.1
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ Mojave\ version\ 10.14)\ for\ Xcode-10.1
Software Update Tool
Downloading Command Line Tools (macOS Mojave version 10.14) for Xcode
Downloaded Command Line Tools (macOS Mojave version 10.14) for Xcode
Installing Command Line Tools (macOS Mojave version 10.14) for Xcode
Done with Command Line Tools (macOS Mojave version 10.14) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
Receiving objects: 3% (4284/114968), 1.68 MiB | 59.00 KiB/s s
...
-
Homebrew 更多操作
-
检查版本
$ brew -v
gem 相关操作
- 查看gem 源
$ gem sources -l
打印如下:
*** CURRENT SOURCES ***
https://rubygems.org/
- 更换gem 源
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
或者 拆分成如下3步:
第一步:移除现有的Ruby镜像
$ gem sources --remove https://rubygems.org/
第二步:再次查看现有的Ruby镜像
$ gem sources -l
第三步:添加国内最新镜像源
$ gem sources -a https://gems.ruby-china.com/
打印如下:
https://gems.ruby-china.com/ added to sources
https://rubygems.org/ removed from sources
ERROR处理
git报错:RPC failed; curl 18 transfer closed with outstanding read data remaining
具体报错
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
解决方法
[Git](https://link.jianshu.com?t=http://lib.csdn.net/base/git) config --global http.postBuffer 524288000
需要注意的是http.postBuffer 后,单位是b,524288000B也就500M左右
网友评论