Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Fetching rexml-3.2.6.gem Fetching xcodeproj-1.23.0.gem Fetching ruby-macho-2.5.1.gem Fetching molinillo-0.8.0.gem Fetching cocoapods-trunk-1.6.0.gem Fetching cocoapods-downloader-2.1.gem Fetching public_suffix-4.0.7.gem Fetching concurrent-ruby-1.2.2.gem Fetching addressable-2.8.6.gem Fetching cocoapods-core-1.14.3.gem Fetching cocoapods-1.14.3.gem Successfully installed rexml-3.2.6 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.
此时我以为是 gem 版本太低,随即更新 gem,输入
1
sudo gem update --system -n /usr/local/bin
更新失败,出现:
1 2 3 4 5 6 7 8
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Updating rubygems-update ERROR: Error installing rubygems-update: rubygems-update-3.5.4 requires Ruby version >= 3.0.0. The current ruby version is 2.6.10.210. Installing RubyGems 3.2.15 Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Restoring gems to pristine condition... ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/pod Target /usr/local/bin/pod already exists. You may want to remove it: rm'/usr/local/bin/pod'
To force the link and overwrite all conflicting files: brew link --overwrite cocoapods
To list all files that would be deleted: brew link --overwrite --dry-run cocoapods
Possible conflicting files are: /usr/local/bin/pod /usr/local/bin/xcodeproj ==> Summary 🍺 /usr/local/Cellar/cocoapods/1.14.3: 13,791 files, 28.8MB ==> Running `brew cleanup cocoapods`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).