美文网首页
[Brew]Brew Update报错

[Brew]Brew Update报错

作者: JaiUnChat | 来源:发表于2016-11-16 15:41 被阅读73次

    报错类似

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/brew.rb:15:in `<main>'
    

    主要原因就是国内的网络访问git的问题
    解决方法如下
    Terminal执行命令如下:

    sudo chown -R $(whoami):admin /usr/local
    cd $(brew --prefix) && git fetch origin && git reset --hard origin/master
    

    然后:

    brew update
    

    Job Done!
    <p >a</p>

    相关文章

      网友评论

          本文标题:[Brew]Brew Update报错

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