解决 Pod install 问题:cannot load such file -- cfpropertylist

今天工程 pod install 时遇到报错:

LoadError - cannot load such file -- cfpropertylist
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/plist.rb:25:in `read_from_path'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/project/object/helpers/file_references_factory.rb:143:in `block in new_xcdatamodeld'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/project/object/helpers/file_references_factory.rb:138:in `each'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/project/object/helpers/file_references_factory.rb:138:in `new_xcdatamodeld'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/project/object/helpers/file_references_factory.rb:27:in `new_reference'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/xcodeproj-1.4.2/lib/xcodeproj/project/object/group.rb:222:in `new_reference'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/project.rb:190:in `add_file_reference'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:187:in `block (2 levels) in add_file_accessors_paths_to_pods_group'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:185:in `each'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:185:in `block in add_file_accessors_paths_to_pods_group'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:180:in `each'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:180:in `add_file_accessors_paths_to_pods_group'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:108:in `block in add_resources'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:142:in `message'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:106:in `add_resources'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:42:in `install!'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator.rb:148:in `install_file_references'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer/xcode/pods_project_generator.rb:63:in `generate!'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:179:in `block in generate_pods_project'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in `section'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:178:in `generate_pods_project'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:115:in `install!'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/command/install.rb:37:in `run'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0@global/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/lib/cocoapods/command.rb:52:in `run'
/Users/alexbalyaev/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/bin/pod:55:in `'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `
'
 Github 里的解决方案很乱,在此整理一下。

三步:

1. 确保 bundle 安装成功

命令行执行:

gem list | grep bundler
若无输出,说明没装,则安装:

sudo gem install bundler


2. 确保 CFPropertyList 只有一个版本

多版本会导致冲突,而找不到文件。

可以先卸载:

sudo gem uninstall CFPropertyList
再安装:

sudo gem install CFPropertyList

3. 使用 bundle 来 pod install

注意了!!根本解决方案就在于这个指令:

bundle exec pod install


参考资料:https://github.com/CocoaPods/CocoaPods/issues/6214







你可能感兴趣的:(iOS)