本文介绍了如何避免“无法加载此类文件-utils/popen"?从OSX上的自制软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在终端中运行brew
时出现错误:
I'm getting an error when I run brew
in the terminal:
/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>'
这些是我的宝石设置:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [universal.x86_64-darwin13]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-13
- GEM PATHS:
- /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
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
推荐答案
该问题主要发生在将OS X更新到El Capitan(OS X 10.11)或macOS Sierra(macOS 10.12)之后.
The problem mainly occurs after updating OS X to El Capitan (OS X 10.11) or macOS Sierra (macOS 10.12).
这是由于El Capitan或更高版本的macOS的新的SIP流程.尝试更改/usr/local
目录的权限:
This is because of file permission issues with El Capitan’s or later macOS's new SIP process. Try changing the permissions for the /usr/local
directory:
$ sudo chown -R $(whoami):admin /usr/local
如果仍然无法正常工作,请在终端会话中使用以下步骤,一切都会好起来:
If it still doesn't work, use these steps inside a terminal session and everything will be fine:
cd /usr/local/Library/Homebrew
git reset --hard
git clean -df
brew update
这可能是因为自制软件未更新.
This may be because homebrew is not updated.
这篇关于如何避免“无法加载此类文件-utils/popen"?从OSX上的自制软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!