sudo gem install cocoapods --user-install
`FirebaseAnalytics` requires CocoaPods version `>= 1.12.0`, which is not satisfied by your current version, `1.11.3`.
$ gem update --system
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /usr/local/opt in PATH, mode 040777
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring json-2.6.2 because its extensions are not built. Try: gem pristine json --version 2.6.2
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ dir_s_mkdir - /Users/mac/.local/share/gem/specs
tongtongdeAir:zhanzhan mac$ sudo gem update --system
Password:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /usr/local/opt in PATH, mode 040777
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring json-2.6.2 because its extensions are not built. Try: gem pristine json --version 2.6.2
Updating rubygems-update
ERROR: Error installing rubygems-update:
rubygems-update-3.5.7 requires Ruby version >= 3.0.0. The current ruby version is 2.6.10.
出现错误:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ dir_s_mkdir - /Users/mac/.local/share/gem/specs
或者这个错误:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
就用这个:
tongtongdeAir:zhanzhan mac$ sudo gem install cocoapods --user-install
Password:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb:21: warning: Insecure world writable dir /usr/local/opt in PATH, mode 040777
Ignoring json-2.6.2 because its extensions are not built. Try: gem pristine json --version 2.6.2
WARNING: You don't have /Users/mac/.local/share/gem/ruby/2.6.0/bin in your PATH,
gem executables will not run.
Successfully installed xcodeproj-1.24.0
Successfully installed cocoapods-downloader-2.1
Successfully installed concurrent-ruby-1.2.3
Successfully installed cocoapods-core-1.15.2
Successfully installed cocoapods-1.15.2