Errors when installing cocoapods with gem

后端 未结 7 1990
旧巷少年郎
旧巷少年郎 2021-02-04 01:41

I am using macOS Mojave and when I try to install cocoapods using gem I am getting the following error.

Building native extensions. This could take a whi

7条回答
  •  北海茫月
    2021-02-04 02:27

    1. Run
      ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
      
      to figure out your ruby configuration.
    2. If the output is a nonexistent MacOSX10.15 path. Like
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
      
      then you should correct the configuration by doing next step.
    3. Run
      sudo xcode-select --switch /Library/Developer/CommandLineTools
      
    4. You can run
      ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
      
      again to see if the path has changed.
    5. The output should be something like
      /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0
      

    Now you can run gem install to install cocoapods!

提交回复
热议问题