最近将 Mac 系统和 Xcode 更新到了最新的版本,Mac 系统为 macOS Catalina 10.15.1,Xcode 最新版本为11.2.1。当我 pod install 后报错如下:
1 2 3
wdy ~/Desktop/workspace/peoject pod install Could not find proper version of cocoapods (1.7.5) in any of the sources Run `bundle install` to install missing gems.
再执行 bundle install
1 2 3 4 5 6 7 8 9 10 11 12
✘ wdy ~/Desktop/workspace/peoject sudo bundle install Password: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching source index from https://gems.ruby-china.org/
Retrying fetcher due to error (2/4): Bundler::HTTPErrorCouldnot fetch specs from https://gems.ruby-china.org/ Retrying fetcher due to error (3/4): Bundler::HTTPErrorCouldnot fetch specs from https://gems.ruby-china.org/ Retrying fetcher due to error (4/4): Bundler::HTTPErrorCouldnot fetch specs from https://gems.ruby-china.org/ Couldnot fetch specs from https://gems.ruby-china.org/
wdy ~/Desktop/workspace/peoject sudo bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://gems.ruby-china.com/........ FetchingCFPropertyList3.0.1 InstallingCFPropertyList3.0.1 Using concurrent-ruby 1.1.5 Using i18n 0.9.5 Fetching minitest 5.8.5 Installing minitest 5.8.5 Using thread_safe 0.3.6 Using tzinfo 1.2.5 Using activesupport 4.2.11.1 Using public_suffix 2.0.5 Using addressable 2.7.0 Using atomos 0.1.3 Fetching babosa 1.0.3 Installing babosa 1.0.3 Using bundler 1.17.2 Fetching claide 1.0.3 Installing claide 1.0.3 Using fuzzy_match 2.0.4 Using nap 1.1.0 Fetching cocoapods-core 1.7.5 Installing cocoapods-core 1.7.5 Using cocoapods-deintegrate 1.0.4 Using cocoapods-downloader 1.2.2 Using cocoapods-plugins 1.0.0 Using cocoapods-search 1.0.0 Using cocoapods-stats 1.1.0 Using netrc 0.11.0 Fetching cocoapods-trunk 1.4.0 Installing cocoapods-trunk 1.4.0 Using cocoapods-try 1.1.0 Using colored2 3.1.2 Using escape 0.0.4 Using fourflusher 2.3.1 Using gh_inspector 1.1.3 Using molinillo 0.6.6 Using ruby-macho 1.4.0 Using nanaimo 0.2.6 Fetching xcodeproj 1.12.0 Installing xcodeproj 1.12.0 Fetching cocoapods 1.7.5 Installing cocoapods 1.7.5 Using colored 1.2 Using highline 1.7.10 Using commander-fastlane 4.4.6 Using declarative 0.0.10 Using declarative-option 0.1.0 Using digest-crc 0.4.1 Using unf_ext 0.0.7.6 Using unf 0.1.4 Using domain_name 0.5.20190701 Using dotenv 2.7.5 Using emoji_regex 1.0.1 Fetching excon 0.67.0 Installing excon 0.67.0 Using multipart-post 2.0.0 Using faraday 0.15.4 Using http-cookie 1.0.3 Using faraday-cookie_jar 0.0.6 Using faraday_middleware 0.13.1 Fetching fastimage 2.1.7 Installing fastimage 2.1.7 Using jwt 2.1.0 Using memoist 0.16.0 Using multi_json 1.13.1 Using os 1.0.1 Using signet 0.11.0 Using googleauth 0.6.7 Using httpclient 2.8.3 Using mime-types-data 3.2019.0904 Using mime-types 3.3 Using uber 0.1.0 Using representable 3.0.4 Using retriable 3.1.2 Using google-api-client 0.23.9 Using google-cloud-env 1.2.1 Using google-cloud-core 1.3.1 Using google-cloud-storage 1.16.0 Fetching json 2.2.0 Installing json 2.2.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" clean
current directory: /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.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/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" install make: /usr/local/opt/coreutils/bin/gmkdir:No such file or directory make: *** [.sitearchdir.-.json.-.ext.time] Error1
make install failed, exit code 2
Gem files will remain installed in /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0for inspection. Results logged to /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0/json-2.2.0/gem_make.out
An error occurred while installing json (2.2.0), andBundler cannot continue. Make sure that `gem install json -v '2.2.0' --source 'https://rubygems.org/'` succeeds before bundling.
InGemfile: fastlane-plugin-firim was resolved to 0.2.0, which depends on firim was resolved to 0.2.1, which depends on fastlane was resolved to 2.131.0, which depends on json
wdy ~/Desktop/workspace/peoject sudo gem install json -v '2.2.0' --source 'https://rubygems.org/' Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. current directory: /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator /Users/wdy/.rvm/rubies/ruby-2.6.0/bin/ruby -I /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0 -r ./siteconf20191204-12556-140ytz4.rb extconf.rb creating Makefile current directory: /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" clean current directory: /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.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/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0/ext/json/ext/generator make "DESTDIR=" install make: /usr/local/opt/coreutils/bin/gmkdir: No such file or directory make: *** [.sitearchdir.-.json.-.ext.time] Error 1 make install failed, exit code 2 Gem files will remain installed in /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/json-2.2.0 for inspection. Results logged to /Users/wdy/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0/json-2.2.0/gem_make.out
wdy ~/Desktop/workspace/peoject brew install coreutils Updating Homebrew... ==> Downloading https://homebrew.bintray.com/bottles/coreutils-8.31.catalina.bottle.1.tar.gz ==> Downloading from https://akamai.bintray.com/72/7262e4c76483ea796454db828c25955be1e6b2bc8e056ba1dd6e92bfe1118da5?_ ######################################################################## 100.0% ==> Pouring coreutils-8.31.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 🍺 /usr/local/Cellar/coreutils/8.31: 476 files, 9.2MB ==> `brew cleanup` has not been run in30 days, running now...
成功之后再去安装那个 json,完整的命令如下:
1 2 3 4 5 6 7 8
wdy ~/Desktop/workspace/peoject sudo gem install json -v '2.2.0' -n /usr/local/bin/ Password: Building native extensions. This could take a while... Successfully installed json-2.2.0 Parsing documentation for json-2.2.0 Installing ri documentation for json-2.2.0 Done installing documentation for json after 1 seconds 1 gem installed