zoukankan      html  css  js  c++  java
  • brew update失败提示:/System/Library/Frameworks/Ruby.framework/的解决方法

    本文由@ray 出品,转载请注明出处。  
    文章链接:http://www.cnblogs.com/wolfray/p/8040701.html


      

    想用brew安装wget,但是提示失败,然后想先 brew update,然后再重新试一下,结果在brew update后出现了这个情况:

    $ brew update
    /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:16:in `<main>'

    不管执行什么brew命令提示依旧,这种情况多发生在 El Capitan系统上,原因大概是更新失败,下面是stackoverflow找到的答案,亲测有效:

    The problem mainly occurs after updating OS X to El Capitan (OS X 10.11). This is mainly because of file permission issues with file El Capitan’s new SIP process. Try changing permissions of/usr/local directory.

    sudo chown -R $(whoami):admin /usr/local 

    如果运行完上面的命令还没有起作用的话,那么再运行下面的命令应该就可以了。这可能是因为homebrew还没有升级的原因。

    • 1. 首先打开终端
      2. $ cd /usr/local  
      3. $ git reset --hard  
      4. $ git clean -df
      5. $ brew update 
     
  • 相关阅读:
    python 安装mysql-python模块
    Linux 目录结构
    python logging 配置
    mac下docker使用笔记
    centos yum 使用笔记
    python 正则使用笔记
    django 动态更新属性值
    nginx 反向代理
    yii2 高级版新建一个应用(api应用为例子)
    tfn2k工具使用介绍
  • 原文地址:https://www.cnblogs.com/wolfray/p/8040701.html
Copyright © 2011-2022 走看看