安装brew
出现
Downloading Command Line Tools for Xcode
使用
xcode-select --install //进行下载插件
warning: /opt/homebrew/bin is not in your path.
我们根据它给的next steps信息再进行解决。
第一步,执行:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/xxx/.zprofile
这里,xxx是你自己的用户名(其实你可以直接复制你的终端里next steps给的命令信息,这里为了避免信息泄露,因此将xxx换为了xxx)
第二步,执行:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/fengguanxi/.zprofile
第三步,执行:
eval "$(/opt/homebrew/bin/brew shellenv)"
执行完成后,执行命令:
brew -v
如果能成功输出版本号,则证明成功安装。
内容
Traceback (most recent call last):
4: from /Users/iosdev/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
3: from /Users/iosdev/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
2: from /usr/local/bin/pod:23:in `<main>'
1: from /Users/iosdev/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/Users/iosdev/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
解决:
1、sudo gem update --system
2、gem install cocoapods
卸载老版本cocopods,执行下面命令,
可能会出现多个版本的cocoapods,可以选择一项一项的删除,也可以选择最后一项全部删除
sudo gem uninstall cocoapods
执行下面命令删除全局的缓存
sudo rm -fr ~/Library/Caches/CocoaPods/
查看本地安装过的cocopods相关东西
gem list --local | grep cocoapods
然后使用命令逐个删除
$ sudo gem uninstall cocoapods-core
$ sudo gem uninstall cocoapods-deintegrate
安装CocoaPods, 这里默认你的brew和ruby已经安装好了
sudo gem install cocoapods
OS X 10.11以后系统的安装cocoapods 指令:
sudo gem install -n /usr/local/bin cocoapods
消除警告,重新编译,发现项目跑起来非常的舒畅!
如果是有其他第三方库或者组件的警告,可以在podFile中增加 :inhibit_warnings => true 来避免编译的时候检查警告。这种方式也会加快编译速度。
pod ' ', :inhibit_warnings => true