自制软件不能在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>'

这里是我的环境设置:

  • 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平台:
  • 红宝石
  • 通用 - 达尔文-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目录的权限。

    $ 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 doctorbrew 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

    上一篇: homebrew not working on OSX

    下一篇: scipy osx 10.9 can't load gfortran library