macOS安装HomeBrew和ruby步骤

2018-07-04  本文已影响18人  编程的蚂蚁

检测:
终端输入:brew install
然后报错:-bash: brew: command not found

换gem源
首先查一下gem源,终端输入:gem sources -l
删除原来的gem源:gem sources --remove https://rubygems.org/
把gem源替换成阿里云的:gem sources -a http://mirrors.aliyun.com/rubygems/

安装HomebBrew:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装ruby:brew install ruby
然后link ruby:brew link ruby

此时,有可能出现一个错误:


link ruby时出现错误

解决办法:
终端输入:brew doctor
这个命令会检测出问题,并给出解决问题的方法


doctor给出的建议

按照建议执行即可:


分别link
完成
上一篇 下一篇

猜你喜欢

热点阅读