这是关于椰子的。安装Podfile时发生错误。就像关于ruby的语法错误

时间:2019-12-20 08:54:43

标签: ios objective-c swift cocoapods

我会尝试搜索的所有内容,例如重新安装我的cocoapods,更新我的gem或cocoapads的版本,但是它不起作用。错误日志如下:

/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for false:FalseClass (NoMethodError)
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/metadata.rb:28:in `new'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source.rb:434:in `refresh_metadata'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/cdn_source.rb:55:in `refresh_metadata'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source.rb:31:in `initialize'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/cdn_source.rb:29:in `initialize'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:310:in `new'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:310:in `block in source_from_path'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:315:in `source_from_path'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:324:in `block in aggregate_with_repos'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:324:in `map'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:324:in `aggregate_with_repos'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:24:in `aggregate'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/source/manager.rb:58:in `all'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface/error_report.rb:173:in `repo_information'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface/error_report.rb:24:in `report'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:66:in `report_error'
    from /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
    from /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
    from /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
    from /usr/local/bin/pod:23:in `load'
    from /usr/local/bin/pod:23:in `<main>'

1 个答案:

答案 0 :(得分:0)

感谢您的帮助,终于找到了这个问题的原因。那是因为我有三个不同版本的Xcode。但是我只使用最新版本。因此,当我切换默认版本的Xcode时,问题解决了。 就像是: sudo xcode-select --switch [您的xcode路径]。