美文网首页
Mac brew 包管理工具安装与常用包

Mac brew 包管理工具安装与常用包

作者: bianruifeng | 来源:发表于2021-10-28 23:37 被阅读0次
  • 安装homebrew(自动切换了国内镜像)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  • 安装最新的ruby
brew install ruby
//设置环境变量  
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
//设置编译器
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"

更改ruby的源

gem sources  //列出默认源
gem sources --remove https://rubygems.org/ //移除默认源
gem sources -add https://gems.ruby-china.com  //添加国内的源
gem sources -u

gem sources -l //查看源
*** CURRENT SOURCES ***
http://gems.ruby-china.com/
  • 安装下载工具 wget
brew install wget
  • 安装python3
brew install python3
  • 设置python3为默认首选
    两个参数 brew install python3 最后返回的路径。
    登陆终端默认的用户zsh还是bash
echo 'alias python="/usr/local/bin/python3"' >> ~/.zshrc
echo 'alias pip="/usr/local/bin/pip3"' >> ~/.zshrc
  • 安装node.js
brew install node
//查看源
pod repo

master
- Type: git (unknown)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/mac/.cocoapods/repos/master

trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/mac/.cocoapods/repos/trunk

//更新(20211108 github的源更新非常快)
pod repo update

清华大学开源软件镜像站

相关文章

网友评论

      本文标题:Mac brew 包管理工具安装与常用包

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