`` JSON::ParserError - A JSON text must at least contain two octets! /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `initialize' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `new' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/json/common.rb:156:in `parse' /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.6.1/lib/cocoapods-core/source/manager.rb:251:in `stored_search_index' /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.6.1/lib/cocoapods-core/source/manager.rb:187:in `updated_search_index' /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.6.1/lib/cocoapods-core/source/manager.rb:118:in `search_by_name' /Library/Ruby/Gems/2.3.0/gems/cocoapods-search-1.0.0/lib/cocoapods-search/command/search.rb:87:in `local_search' /Library/Ruby/Gems/2.3.0/gems/cocoapods-search-1.0.0/lib/cocoapods-search/command/search.rb:63:in `run' /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run' /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>' /usr/local/bin/pod:22:in `load' /usr/local/bin/pod:22:in `<main>' ``
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=A+JSON+text+must+at+least+contain+two+octets%21&type=Issues
If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods... - pod search not work JSON ParserError https://github.com/CocoaPods/CocoaPods/issues/5172 [closed] [10 comments] 30 Aug 2018
- pod install-- JSON::ParserError - A JSON text must at least contain two octets! https://github.com/CocoaPods/CocoaPods/issues/6692 [closed] [7 comments] 10 Dec 2017
具体我也不知道为毛这样,我试过重装cocoapods不行,试过删除repo再重建也是不行。
搜索了一下JSON::ParserError - A JSON text must at least contain two octets!这句话,说是需要删除~/Library/Caches/CocoaPods/search_index.json文件,接着我去看了这个文件,发现大小是0的,所以删除掉了,再试了一遍pod search xxx,居然就可以了。