美文网首页
macOS安装HomeBrew和ruby步骤

macOS安装HomeBrew和ruby步骤

作者: 编程的蚂蚁 | 来源:发表于2018-07-04 19:52 被阅读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
完成

相关文章

网友评论

      本文标题:macOS安装HomeBrew和ruby步骤

      本文链接:https://www.haomeiwen.com/subject/aasyuftx.html