加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

个人常用镜像

发布时间:2020-12-17 01:25:13 所属栏目:百科 来源:网络整理
导读:Homebrew Homebrew 源代码仓库 (brew upate) 替换USTC镜像: cd "$(brew --repo)"git remote set-url origin https://mirrors.ustc.edu.cn/brew.git 重置为官方地址: cd "$(brew --repo)"git remote set-url origin https://github.com/Homebrew/brew.git H

Homebrew

Homebrew 源代码仓库 (brew upate)

替换USTC镜像:

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

重置为官方地址:

cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

Homebrew 预编译二进制软件包

对于 zsh 用户:

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

对于 bash 用户:

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

npm

cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

alias

alias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc"

# Or alias it in .bashrc or .zshrc
$ echo 'n#alias for cnpmnalias cnpm="npm --registry=https://registry.npm.taobao.org   --cache=$HOME/.npm/.cache/cnpm   --disturl=https://npm.taobao.org/dist   --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

Ruby

RVM

echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > ~/.rvm/user/db

RubyGems

gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -l
https://gems.ruby-china.com
# 确保只有 gems.ruby-china.com

使用 Gemfile 和 Bundler

bundle config mirror.https://rubygems.org https://gems.ruby-china.com

这样你不用改你的 Gemfile 的 source。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读