1. 更新了系统,发现 $ sudo gem install cocoapods 安装报错。
$ sudo gem install cocoapods Password: Building native extensions. This could take a while... /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777 ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension. current directory: /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c /Users/WeepYan/.rvm/rubies/ruby-2.6.0/bin/ruby -I /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0 -r ./siteconf20201208-3504-1o2g6p3.rb extconf.rb /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/mkmf.rb:1565: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777 checking for ffi.h... no checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes checking for ffi_prep_closure_loc() in -lffi... yes checking for ffi_prep_cif_var()... yes checking for ffi_raw_call()... yes checking for ffi_prep_raw_closure()... yes creating extconf.h creating Makefile current directory: /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c make "DESTDIR=" clean current directory: /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c make "DESTDIR=" compiling AbstractMemory.c compiling ArrayType.c compiling Buffer.c compiling Call.c compiling ClosurePool.c compiling DynamicLibrary.c compiling Function.c compiling FunctionInfo.c compiling LastError.c compiling LongDouble.c compiling MappedType.c compiling MemoryPointer.c compiling MethodHandle.c compiling Platform.c compiling Pointer.c compiling Struct.c compiling StructByValue.c compiling StructLayout.c compiling Thread.c compiling Type.c compiling Types.c compiling Variadic.c compiling ffi.c linking shared-object ffi_c.bundle ld: warning: directory not found for option '-L/usr/local/opt/libksba/lib' ld: warning: directory not found for option '-L/usr/local/opt/libksba/lib' ld: warning: directory not found for option '-L/usr/local/opt/libksba/lib' current directory: /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c make "DESTDIR=" install make: /usr/local/opt/coreutils/bin/gmkdir: No such file or directory make: *** [.sitearchdir.time] Error 1 make install failed, exit code 2 Gem files will remain installed in /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1 for inspection. Results logged to /Users/WeepYan/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-17/2.6.0/ffi-1.13.1/gem_make.out
2. 安装 coreutils即可 $ brew install coreutils
$ brew install coreutils Updating Homebrew... ==> Downloading https://homebrew.bintray.com/bottles/coreutils-8.32.catalina.bot ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/f40ba727ec1bb54300c7c ######################################################################## 100.0% ==> Pouring coreutils-8.32.catalina.bottle.1.tar.gz ==> Caveats Commands also provided by macOS have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc like: PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" ==> Summary