美文网首页
执行pod install时报command not found

执行pod install时报command not found

作者: 想想8606 | 来源:发表于2020-05-06 12:01 被阅读0次

执行pod install时报command not found

解决步骤:

首先cd到根目录

1、执行sudo gem install cocoapods -V,结果如图1-1:

1-1

顺着这个error搜解决方案,越跑越远。

2、中途看到有博客说可能是ruby版本过低,于是执行ruby -v来查看一下我们的ruby版本,结果是:

ruby 2.3.7p456 

3、突然发现报错中有一句current directory: 。。。。。

mkmf.rb can't find header files for ruby at 。。。。

所以是不是路径出啦问题呢?

我们来试一下:

(1)sudo rm -rf /Library/Developer/CommandLineTools

(2)xcode-select --install

(3)sudo xcodebuild -license accept

(4)open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

执行完后会显示 gems installed,如图1-2

1-2

5、

mkdir -p $HOME/Software/ruby

export GEM_HOME=$HOME/Software/ruby

gem install cocoapods(执行这句话时会出现图2-1的效果)

export PATH=$PATH:$HOME/Software/ruby/bin

pod --version

6、cd到对应的项目,去pod install 就好了

相关文章

网友评论

      本文标题:执行pod install时报command not found

      本文链接:https://www.haomeiwen.com/subject/qxwightx.html