zoukankan      html  css  js  c++  java
  • no implicit conversion of nil into String

    一、Cocoapod 执行pod install命令时报错

      

    [!] An error occurred while processing the post-install hook of the Podfile.
    
    no implicit conversion of nil into String
    
    /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/pathname.rb:349:in `initialize'
    /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/pathname.rb:349:in `new'
    /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/pathname.rb:349:in `+'
    /Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.8.1/lib/xcodeproj/project.rb:103:in `open'
    /Users/xxx/Documents/WorkCode/DoorCamera/mihomeinternal/MiHome/SegmentPodfile/pre_and_post_install.rb:20:in `block in pod_pre_post_install'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.6.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:701:in `run_podfile_post_install_hook'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:689:in `block in run_podfile_post_install_hooks'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:145:in `message'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:688:in `run_podfile_post_install_hooks'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:211:in `block in generate_pods_project'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:208:in `generate_pods_project'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:139:in `install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48: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:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
    

     

    二、解决

      这个原因是因为ruby的版本比较低导致的,需要更新ruby的版本

      执行以下命令:

      

    ➜  MiHome git:(doorscamera) ✗ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
    HEAD is now at b4f73e616 Merge pull request #6016 from jonchang/update-policy
    Already up-to-date.
    ➜  Homebrew git:(stable) rvm gemset empty default
    ➜  Homebrew git:(stable) rvm use 3 --default
    Required ruby-2.2.5 is not installed.
    To install do: 'rvm install "ruby-3"'
    ➜  Homebrew git:(stable) rvm gemset empty defaultrvm install "ruby-3
    dquote> 
    ➜  Homebrew git:(stable) rvm install "ruby-3"
    

      重新安装ruby解决

  • 相关阅读:
    Educational Codeforces Round 19 题解【ABCDE】
    喵哈哈村的魔法考试 Round #14 (Div.2) 题解
    Codeforces Round #408 (Div. 2) 题解【ABCDE】
    喵哈哈村的魔法考试 Round #13 (Div.2) 题解
    喵哈哈村的魔法考试 Round #12 (Div.2) 题解
    April Fools Contest 2017 题解
    Kaggle Titanic solution 纯规则学习
    喵哈哈村的魔法考试 Round #11 (Div.2) 题解
    Codeforces Round #406 (Div. 1) B. Legacy 线段树建图跑最短路
    Codeforces Round #407 div2 题解【ABCDE】
  • 原文地址:https://www.cnblogs.com/doudouyoutang/p/10716376.html
Copyright © 2011-2022 走看看