美文网首页Elixir 编程
解决中国安装 hex 包不稳定的办法

解决中国安装 hex 包不稳定的办法

作者: linjunpop | 来源:发表于2016-05-20 22:44 被阅读479次

2016-10-20 更新:⚠️ UPYUN 官方给了一个镜像,推荐使用这个:https://ruby-china.org/topics/31631

因为 Hex 默认使用 Fastly 作为镜像,国内的网络时不时出现无法访问或者下载极慢的状态

这里提供了一个镜像源( http://hex.linjun.me ),让国内环境下使用 Mix 的体验更友好

永久设置为使用此镜像

  • Mix $ mix hex.config mirror_url https://o70o6u4j7.qnssl.com
  • Rebar3 添加 {rebar_packages_cdn, "https://o70o6u4j7.qnssl.com"}. 到全局的或者项目层级的 rebar.config 文件里

临时使用

  • Mix $ HEX_MIRROR=https://o70o6u4j7.qnssl.com mix deps.get
  • Rebar3 $ HEX_CDN=https://o70o6u4j7.qnssl.com rebar3 update

相关文章

网友评论

  • 9e67261e22c7:大哥
    HEX_MIRROR=https://o70o6u4j7.qnssl.com mix deps.get
    无效,应该怎么处理呢?谢谢!报错为:

    ** (Mix) Could not verify authenticity of fetched registry file. This may happen because a proxy or some entity is interfering with the download or because you don't have a public key to verify the registry.

    You may try again later or check if a new public key has been released in our public keys page: https://hex.pm/docs/public_keys
    jsvisa:可以尝试使用 UPYUN 提供的 hex.pm 镜像,设置环境变量到 https://hexpm.upyun.com 即可
    linjunpop:@startfromscu 现在应该可以了,你看看?
  • M1EgKr:感谢
  • 勤劳一沙鸥:买了那本书,再看前几章,容易理解多了。

本文标题:解决中国安装 hex 包不稳定的办法

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