Mac安装binutils工具

  • 1.命令安装
  • 2.解决办法

1.命令安装

brew install binutils

出现以下错误:

See `config.log' for more details.
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': no implicit conversion of nil into String (TypeError)from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/ENV/4.3/gcc-4.2:4:in `<main>'READ THIS: https://git.io/brew-troubleshooting/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:359:in `open_http': 422 Unprocessable Entity (GitHub::Error)from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `catch'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:717:in `open'from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:31:in `open'from /usr/local/Library/Homebrew/utils.rb:505:in `open'from /usr/local/Library/Homebrew/utils.rb:535:in `issues_matching'from /usr/local/Library/Homebrew/utils.rb:567:in `issues_for_formula'from /usr/local/Library/Homebrew/exceptions.rb:222:in `fetch_issues'from /usr/local/Library/Homebrew/exceptions.rb:218:in `issues'from /usr/local/Library/Homebrew/exceptions.rb:261:in `dump'from /usr/local/Library/brew.rb:186:in `rescue in <main>'from /usr/local/Library/brew.rb:76:in `<main>'

随后又执行:

brew update

出现以下错误:

Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this.You should probably change the ownership and permissions of /usr/local
back to your user account.sudo chown -R $(whoami):admin /usr/local

接着又执行:

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

又出现:chown: /usr/local: Operation not permitted

2.解决办法

  1. 先卸载ruby
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
  1. 再安装ruby
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. 安装binutils
brew install binutils