1、Homebrew更新太慢,更换源
替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
当以上镜像失败后,可重置回原设置
重置brew.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
Homebrew Bottles源处理
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
2、xcpretty安装
gem install xcpretty
3、统计近30天在项目里的提交记录
git log --since=30.day.ago --author="$(git config --get user.name 你的邮箱)" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
4、安装输入法时:https://github.com/rime/squirrel/blob/master/INSTALL.md
安装了以下命令,不需要时可删除
# dev tools:
brew install cmake
brew install git
# libraries:
brew install boost
5、如何快速正确的安装 Ruby, Rails 运行环境
https://ruby-china.org/wiki/install_ruby_guide/
6、gem 镜像安装及源切换
https://gems.ruby-china.org/
7、提示升级ruby
rvm install "ruby-2.5.0"
8、安装完rvm后,再开一个窗口提示rvm找不到
解决办法
image.png
可以看到文件
.bashrc文件有个路径
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
把此路径放入到文件.bash_profile中即可
image.png
然后再执行命令
source ~/.bashrc
然后新开终端窗口就能正常使用rvm命令了
image.png
9、node安装指定版本
brew search node查看支持版本安装8版本
brew install node@8









网友评论