自制软件不能在OSX上工作
在终端上运行brew命令时出现此错误。 需要帮助解决。
/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>'
这里是我的环境设置:
更新OS X到El Capitan(OS X 10.11)或macOS Sierra(macOS 10.12)后,问题主要发生。 这主要是因为El Capitan或更高版本的macOS新的SIP进程存在文件许可问题。 尝试更改/ usr / local目录的权限。
$ sudo chown -R $(whoami):admin /usr/local
如果仍然不起作用,请使用以下步骤,一切都会好起来的。 这可能是因为自制软件没有更新。
1. open terminal
2. $ cd /usr/local/Library/Homebrew
3. $ git reset --hard
4. $ git clean -df
5. $ brew update
首先,打开终端并cd /usr/local/
和git status
来查看Homebrew是否干净。
如果脏, git reset --hard && git clean -df
然后brew doctor
, brew update
如果仍然损坏,请在终端中尝试以下操作:
$ 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
卸载homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
然后重新安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
警告:这个脚本将删除:/ Library / Caches / Homebrew / - thij benjaminsila
链接地址: http://www.djcxy.com/p/75473.html