您好,登錄后才能下訂單哦!
這篇文章主要介紹CocoaPods中出現(xiàn)LoadError - cannot load such file -- nanaimo錯誤怎么辦,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!
CocoaPods 出現(xiàn)LoadError - cannot load such file -- nanaimo錯誤解決辦法
如果經(jīng)常使用 CocoaPods 進行個人類庫的提交和更新,那么肯定會遇到這樣的一個錯誤。如題:LoadError - cannot load such file -- nanaimo,翻譯過來就是 LoadError - 無法加載此類文件 - nanaimo。該錯誤產(chǎn)生的時機一般是在驗證 .podspec 文件的時候。具體的錯誤呈現(xiàn)形式是這樣的:
benpaobaodeiMac-2:WZYUnlimitedScrollView bpb$ pod lib lint -> WZYUnlimitedScrollView ――― MARKDOWN TEMPLATE ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ### Command ``` /usr/local/bin/pod lib lint ``` ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack ``` CocoaPods : 1.2.0.beta.1 Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] RubyGems : 2.0.14.1 Host : Mac OS X 10.12.1 (16B2555) Xcode : 8.2.1 (8C1002) Git : git version 2.10.1 (Apple Git-78) Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib Repositories : master - https://github.com/CocoaPods/Specs.git @ 3d3d5f5d2fbb80e043adfd3ad3357a10845cf349 ``` ### Plugins ``` cocoapods-deintegrate : 1.0.1 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.0 cocoapods-stats : 1.0.0 cocoapods-trunk : 1.1.1 cocoapods-try : 1.1.0 ``` ### Error ``` LoadError - cannot load such file -- nanaimo /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/project.rb:353:in `block in save' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/project.rb:353:in `open' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/project.rb:353:in `save' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:412:in `create_app_project' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:300:in `block in perform_extensive_analysis' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:295:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:295:in `perform_extensive_analysis' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/validator.rb:79:in `validate' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/command/lib/lint.rb:62:in `block in run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/command/lib/lint.rb:50:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/command/lib/lint.rb:50:in `run' /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/lib/cocoapods/command.rb:50:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0.beta.1/bin/pod:55:in `<top (required)>' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `<main>' ``` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=cannot+load+such+file+--+nanaimo&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... - LoadError - cannot load such file -- nanaimo https://github.com/CocoaPods/CocoaPods/issues/6281 [closed] [12 comments] 2 days ago - help! cannot load such file -- nanaimo https://github.com/CocoaPods/CocoaPods/issues/6312 [closed] [6 comments] 6 weeks ago - LoadError - cannot load such file -- nanaimo https://github.com/CocoaPods/CocoaPods/issues/6214 [closed] [30 comments] 4 weeks ago and 10 more at: https://github.com/cocoapods/cocoapods/search?q=cannot%20load%20such%20file%20--%20nanaimo&type=Issues&utf8=?
上述錯誤,可以有兩種方式進行解決。大家可以分別嘗試,總有一種適合你。
方式一,重新安裝 CocoaPods 的類庫。
先清空 CocoaPods 的緩存:
$ sudo rm -rf ~/.cocoapods/repos/master $ sudo rm -fr ~/Library/Caches/CocoaPods/
再重新安裝 CocoaPods 的類庫:
$ pod setup
注意,細(xì)心的童鞋可能發(fā)現(xiàn)。上面兩行清楚緩存的語句不太一樣。分別是 rm -rf 和 rm -fr,它們其實是沒有區(qū)別的,表示強制(f:不提示)刪除文件和目錄(r:刪除)
但方式一可能用起來不會那么順暢,該錯誤產(chǎn)生的大多數(shù)原因還是應(yīng)該用方式二來解決。
方式二,對 nanaimo 進行刪除并重新加載
$ sudo gem uninstall nanaimo $ sudo gem install nanaimo
運行上面兩行代碼的結(jié)果:
benpaobaodeiMac-2:WZYUnlimitedScrollView bpb$ sudo gem uninstall nanaimo Password: Select gem to uninstall: 1. nanaimo-0.2.2 2. nanaimo-0.2.3 3. All versions > 3 Successfully uninstalled nanaimo-0.2.2 You have requested to uninstall the gem: nanaimo-0.2.3 xcodeproj-1.4.1 depends on nanaimo (~> 0.2.0) If you remove this gem, these dependencies will not be met. Continue with Uninstall? [yN] y Successfully uninstalled nanaimo-0.2.3 benpaobaodeiMac-2:WZYUnlimitedScrollView bpb$ sudo gem install nanaimo Fetching: nanaimo-0.2.3.gem (100%) Successfully installed nanaimo-0.2.3 Parsing documentation for nanaimo-0.2.3 Installing ri documentation for nanaimo-0.2.3 1 gem installed
以上是“CocoaPods中出現(xiàn)LoadError - cannot load such file -- nanaimo錯誤怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。