homebrew not working on OSX
在终端上运行brew命令时出现此错误。需要帮助解决。
1 2 3 4 5 6 7 8 9 | /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 -- utils/popen (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/utils.rb:6: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:9: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>' |
这是我的env gem设置:
- RUBYGEMS版本:2.0.14
- RUBY VERSION:2.0.0(2014-02-24 patchlevel 451)[universal.x86_64-darwin13]
- 安装目录:/ Library/Ruby/Gems/2.0.0
- RUBY EXECUTABLE:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- 可执行的目录:/ usr / bin
-
RUBYGEMS PLATFORMS:
- 红宝石
- 通用 - 达尔文-13
-
创业板路径:
- /Library/Ruby/Gems/2.0.0
- /Users/ronaldkwan/.gem/ruby/2.0.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
-
创业板配置:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
问题主要发生在将OS X更新为El Capitan(OS X 10.11)或macOS Sierra(macOS 10.12)之后。这主要是因为El Capitan或更高版本的macOS新SIP进程存在文件权限问题。尝试更改/ usr / local目录的权限。
1 | $ sudo chown -R $(whoami):admin /usr/local |
如果仍然无效,请使用以下步骤,一切都会好的。这可能是因为自制软件没有更新。
1 2 3 4 5 | 1. open terminal 2. $ cd /usr/local/Library/Homebrew 3. $ git reset --hard 4. $ git clean -df 5. $ brew update |
首先,打开终端和
如果脏了,
然后
如果仍然坏了,请在终端中尝试:
1 2 | $ sudo rm /System/Library/Frameworks/Ruby.framework/Versions/Current $ sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8 /System/Library/Frameworks/Ruby.framework/Versions/Current |
这将迫使Homebrew从系统中使用ruby 1.8
卸载自制程序:
1 | ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" |
然后重新安装
1 | ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
警告:此脚本将删除:/ Library / Caches / Homebrew / - thks benjaminsila
在我的情况下,我只需要删除brew可执行文件:
1 | sudo rm -f `which brew` |
然后重新安装自制软件:
1 | ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
更新到El Capitan后,/ usr / local目录具有root:wheel权限。
将权利更改回给我
1 | sudo chown -R $(whoami):admin /usr/local |
和
1 | brew doctor && brew update |
帮助我重新开始酿造。
首先我执行了......
1 | sudo chown -R $(whoami):admin /usr/local |
然后...
1 | cd $(brew --prefix) && git fetch origin && git reset --hard origin/master |
这个问题应该在最新版本的自制程序中修复。只是尝试重新安装自制软件。如何描述:Homebrew主页
对我来说,感觉你缺少popen的头文件,这是一个C系统库。
使用命令行工具检查是否已成功安装xcode并已接受许可。
Xcode - 安装命令行工具