no implicit conversion of nil into String

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

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[!] 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的版本

  执行以下命令:

  

1
2
3
4
5
6
7
8
9
10
➜  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解决

posted @   兜兜有糖的博客  阅读(3788)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示