Cocoapods: pod search not work JSON ParserError

Created on 18 Apr 2016  ยท  10Comments  ยท  Source: CocoaPods/CocoaPods

Report

  • Run pod search PureLayout
  • List the search result
  • can not get the result list, and shows JSON::ParserError - A JSON text must at least contain two octets!

    Stack

   CocoaPods : 1.0.0.beta.8
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.11.4 (15E65)
       Xcode : 7.3 (7D175)
         Git : git version 2.6.4 (Apple Git-63)
Ruby lib dir : /Users/name/.rvm/rubies/ruby-2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ d8648f8172b778faf0b1fab50c1026c4d7dfa36a

Plugins

cocoapods-deintegrate : 1.0.0.beta.1
cocoapods-plugins     : 1.0.0.beta.1
cocoapods-search      : 1.0.0.beta.2
cocoapods-stats       : 1.0.0.beta.4
cocoapods-trunk       : 1.0.0.beta.4
cocoapods-try         : 1.0.0.beta.4

Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'

target 'MapleStory' do

pod 'AFNetworking', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
pod 'SVProgressHUD', '~> 2.0.2'
pod 'PureLayout', '~> 3.0.1'
pod 'MJRefresh', '~> 3.1.0'
pod 'UICKeyChainStore', '~> 2.1.0'
pod 'ReactiveCocoa', '~> 2.5'
pod 'JSONModel', '~> 1.2.0'
pod 'DZNEmptyDataSet', '~> 1.7.3'
end

target 'MapleStoryTests' do

end

target 'MapleStoryUITests' do

end

Error

JSON::ParserError - A JSON text must at least contain two octets!
/Users/name/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/json/common.rb:156:in `initialize'
/Users/name/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/json/common.rb:156:in `new'
/Users/name/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/json/common.rb:156:in `parse'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.0.beta.8/lib/cocoapods-core/source/manager.rb:251:in `stored_search_index'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.0.beta.8/lib/cocoapods-core/source/manager.rb:187:in `updated_search_index'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.0.beta.8/lib/cocoapods-core/source/manager.rb:118:in `search_by_name'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-search-1.0.0.beta.2/lib/cocoapods-search/command/search.rb:85:in `local_search'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-search-1.0.0.beta.2/lib/cocoapods-search/command/search.rb:61:in `run'
/Users/name/.rvm/gems/ruby-2.3.0/gems/claide-1.0.0.beta.3/lib/claide/command.rb:334:in `run'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.0.beta.8/lib/cocoapods/command.rb:50:in `run'
/Users/name/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.0.beta.8/bin/pod:44:in `<top (required)>'
/Users/name/.rvm/gems/ruby-2.3.0/bin/pod:23:in `load'
/Users/name/.rvm/gems/ruby-2.3.0/bin/pod:23:in `<main>'
/Users/name/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/Users/name/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
awaiting input

Most helpful comment

Ah that'd be the issue. Try deleting it and searching again?

c @manuyavuz

All 10 comments

Can you please gist the contents of ~/Library/Caches/CocoaPods/search_index.json? Thanks!

there is no such file at ~/Library/Caches/CocoaPods/search_index.json

oh sorry the file exists,but it's empty

Ah that'd be the issue. Try deleting it and searching again?

c @manuyavuz

thx,it's ok now @segiddins

@segiddins NB

@segiddins can you explain why it is?

hi, @segiddins. I meet the same problem, but the way you give does't effect.

pod install
Analyzing dependencies

โ€•โ€•โ€• MARKDOWN TEMPLATE โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•

Command

/usr/local/bin/pod install

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.2.1
        Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
    RubyGems : 2.6.7
        Host : Mac OS X 10.12.3 (16D32)
       Xcode : 8.2.1 (8C1002)
         Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /usr/local/Cellar/ruby/2.3.1/lib
Repositories : master -  @ fatal: Not a git repository (or any of the parent directories): .git
               sdo-specs - [email protected]:iOS/Specs.git @ 9585c339b0892bffc65e85d5fe26ee59b2df84ed

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0

Podfile

source '[email protected]:iOS/Specs.git'

platform:ios, '8.0'
inhibit_all_warnings!
GKitVersion = '0.16.14'

target 'gmm' do
    pod 'BXFoundation','1.0.7'
    pod 'GChat4GMM','1.7.61'
    pod 'GKit/Privacy',GKitVersion
    pod 'GKit/TableCells',GKitVersion
    pod 'GKit/GetPhotos',GKitVersion
    pod 'GKit/ScrollPhotoView',GKitVersion
    pod 'GKit/GReportMTA',GKitVersion
    pod 'GKit/ImageScroll',GKitVersion
    pod 'IFXRefresher', '1.1.2'
    pod 'GBao','2.0.12'
    pod 'AFNetworking', '3.1.0'
    pod 'SDWebImage', '3.7.3'
    pod 'HTCopyableLabel','0.0.7'
    pod 'BlocksKit','2.2.5'
    pod 'MJRefresh','3.1.12'
    pod 'Bugly', '2.3.1'
    pod 'WeexSDK'
    pod 'GMMLogin', '1.0.3'
    pod 'GHomePush', '1.0.6'
    pod 'FDStackView', '1.0'
    pod 'ActionSheetPicker-3.0', '2.2.0'
    pod 'SSZipArchive', '1.7'

end

Error

JSON::ParserError - A JSON text must at least contain two octets!
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `initialize'
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `new'
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `parse'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification/json.rb:46:in `from_json'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:567:in `block in from_string'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:559:in `chdir'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:559:in `from_string'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:542:in `from_file'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification/set.rb:45:in `specification'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source.rb:265:in `search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:362:in `create_set_from_sources'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:332:in `find_cached_set'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:305:in `specifications_for_dependency'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:123:in `search_for'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:221:in `block in sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `sort_by'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:165:in `initial_state'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:106:in `start_resolution'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:64:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolver.rb:42:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:77:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:742:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:739:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:76:in `analyze'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:236:in `analyze'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:110:in `install!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/command/install.rb:41:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.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...

NB

there is no such file at ~/Library/Caches/CocoaPods/search_index.json
Please do
rm ~/Library/Caches/CocoaPods/search_index.json
pod search *

Was this page helpful?
0 / 5 - 0 ratings

Related issues

geoffharcourt picture geoffharcourt  ยท  64Comments

jhudsonWA picture jhudsonWA  ยท  65Comments

mikehouse picture mikehouse  ยท  128Comments

azamsharp picture azamsharp  ยท  59Comments

sinoru picture sinoru  ยท  59Comments