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


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

  1. $ brew update
  2. /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)
  3. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  4. from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
  5. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  6. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  7. from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
  8. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  9. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  10. 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.

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

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

    1. 1. 首先打开终端
    2. 2. $ cd /usr/local
    3. 3. $ git reset --hard
    4. 4. $ git clean -df
    5. 5. $ brew update 
 

brew update失败提示:/System/Library/Frameworks/Ruby.framework/的解决方法的更多相关文章

  1. #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby

    #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby # This script installs to ...

  2. zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

    系统升级为 macOS Catalina 发现 CocoaPods 不管用了. 解决方法: 打开 iTerm2 sudo gem update --system 输入电脑密码,然后 sudo gem ...

  3. ios开发之--/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file

    有一段时间没有用pod了,突然报了个这种错误,查了下,原来是没有更新pod, 1,更新gem:sudo gem update --system 2,查看gem源是否是最新的:gem sources - ...

  4. dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserNotifications解决办法

    这个问题产生的原因是:在iOS 10中有UserNotifications这个framework而iOS 9中没有,在iOS 9上运行的时候,会因为找不到而出错. 解决办法是,修改UserNotifi ...

  5. error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted

    参考: Python pip安装模块报错 Mac升级到EI Captain之后pip install 无法使用问题 error: could not create '/System/Library/F ...

  6. [iOS Xcode8报错]dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserN

    [iOS Xcode8报错]dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserN ...

  7. c++连接mysql并提示“无法解析的外部符号 _mysql_server_init@12”解决方法&提示缺少“libmysql.dll”

    课程作业要用c++连接mysql server,但是出现些小问题,经查阅资料已经解决,做一下笔记. 环境:vs2017, mysql版本是8.0.16-winx64. 设置项目属性   项目 -  C ...

  8. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!&&在eclipse.ini中为eclipse指定jdk启动

    参考:http://blog.csdn.net/zyz511919766/article/details/7442633 http://blog.sina.com.cn/s/blog_028f0c1c ...

  9. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!

    启动 Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误的解决方法 http://blog.csdn.net/z ...

随机推荐

  1. spring项目启动需要的几个注解

    1.@ComponentScan注解,spring context包下,可以理解嘛,扫描srping bean放在ioc容器中的. ApplicationContext是接口,就是IOC容器嘛,也在这 ...

  2. [Vue @Component] Extend Vue Components in TypeScript

    This lesson shows how you can extend and reuse logic in Vue components using TypeScript inheritance. ...

  3. 3.5 在批处理模式下使用mysql

    在前面的章节中,你交互式地使用mysql输入查询而且查看结果.你也能够以批模式执行mysql.为了做到这些.把你想要执行的命令放在一个文件里,然后告诉mysql从文件读取它的输入: shell> ...

  4. objc_setAssociatedObject 1

    [Objective-C]关联(objc_setAssociatedObject.objc_getAssociatedObject.objc_removeAssociatedObjects) 标签:  ...

  5. 5分钟APIG实战: 使用Rust语言快速构建API能力开放

    序言:Rust语言简介 参与过C/C++大型项目的同学可能都经历过因为Null Pointer.Memory Leak等问题“被” 加班了不知道多少个晚上.别沮丧,你不是一个人,Mozilla Fir ...

  6. oc79--数组的内存管理

    // // main.m // 集合(数组)对象的内存管理(MRC中) // #import <Foundation/Foundation.h> #import "Person. ...

  7. Visual Studio AI

    Visual Studio 完全AI手册 - 从0开始配置环境 https://www.cnblogs.com/ms-uap/p/9123033.html 零.前提条件 一台能联网的电脑,使用win1 ...

  8. [Codeforces Round495B] Sonya and Exhibition

    [题目链接] https://codeforces.com/contest/1004/problem/B [算法] 不难发现 , 最优解一定是01010101.... 时间复杂度 : O(N) [代码 ...

  9. VPS主机

    腾讯云企业认证 备案域名要是顶级域名格式,所以不能是www.blueheartzf.com,而要是blueheartzf.com

  10. PCB 使用Nginx让IIS7实现负载均衡

    在PCB行业众多系统中PCB工程系统是主要的数据生产者, 它与外部系统数据交互是最多的,经统计接口数超过100个之多;这么多接口调用与管理起来是混乱的,所以今年年初对工程集成方式改造,将原来的点对点的 ...