macOS High Sierra 10.13.2运行brew list报错Device error求助
brew list Errno::EDEVERR Error on macOS High Sierra 10.13.2 Hey there, I’ve dealt with this exact device error on older macOS versions before—let’s break down how to fix it step by step.
Your Scenario
You’re running macOS High Sierra 10.13.2, and executing brew list throws this error:
$ brew list /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': Device error @ io_fillbuf - fd:7 /usr/local/Homebrew/Library/Homebrew/build_environment.rb (Errno::EDEVERR) 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/Homebrew/Library/Homebrew/formula.rb:7:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/readall.rb:1:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/tap.rb:3:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/compat/tap.rb:1:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/compat.rb:2:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/global.rb:63:in `<top (required)>' 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 /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/Homebrew/Library/Homebrew/brew.rb:21:in `<main>'
This error typically stems from disk permission issues, corrupted Homebrew files, or system Ruby access problems. Let’s tackle each possible fix:
Step 1: Reset Homebrew Directory Permissions
macOS High Sierra enforces strict system permissions, so your user account might not have full access to Homebrew files. Run these commands to fix that:
sudo chown -R $(whoami) /usr/local/Homebrew sudo chmod -R u+rwx /usr/local/Homebrew
Step 2: Run Homebrew Diagnostics
Homebrew has a built-in tool to detect and repair installation issues. Execute:
brew doctor
Follow all the recommendations it provides—this will often resolve missing files or broken symlinks causing the error.
If that doesn’t work, force an update and upgrade to refresh core files:
brew update --force brew upgrade --force-bottle
Step 3: Check for Disk Corruption
Since this is a device error, rule out filesystem issues with Disk Utility:
- Open Disk Utility (found in
/Applications/Utilities) - Select your system drive from the left sidebar
- Click First Aid and run a full scan
- Apply any repairs suggested
Step 4: Install a User-Level Ruby (If All Else Fails)
The system Ruby on High Sierra can sometimes have permission conflicts. Install a Ruby version managed by Homebrew to bypass this:
brew install ruby echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
Step 5: Reinstall Homebrew (Last Resort)
If none of the above work, completely reinstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After trying these steps, run brew list again—it should work without the device error.
内容的提问来源于stack exchange,提问作者wei zhao




