很久不寫 ios 代碼,在老項(xiàng)目中使用$ pod install指令時(shí)帚称,出現(xiàn)了[!] Oh no, an error occurred. 報(bào)錯。
查版本:
pod --version
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
1.5.3
升級 gem:
sudo gem update --system
結(jié)果:
Updating rubygems-update
Fetching: rubygems-update-3.0.4.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
sudo gem update -n /usr/local/bin --system
結(jié)果
Updating rubygems-update
Successfully installed rubygems-update-3.0.4
Parsing documentation for rubygems-update-3.0.4
Installing ri documentation for rubygems-update-3.0.4
Installing darkfish documentation for rubygems-update-3.0.4
Done installing documentation for rubygems-update after 64 seconds
Parsing documentation for rubygems-update-3.0.4
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.0.4
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem
升級 gem 進(jìn)行不順利,也搞不懂是什么原因顿苇,就直接升級 cocoapods吧撩满。
sudo gem install -n /usr/local/bin cocoapods
Password:
Fetching fourflusher-2.3.1.gem
Fetching ruby-macho-1.4.0.gem
Fetching cocoapods-1.7.5.gem
Successfully installed xcodeproj-1.11.0
Successfully installed fourflusher-2.3.1
Successfully installed ruby-macho-1.4.0
Successfully installed cocoapods-1.7.5
Parsing documentation for xcodeproj-1.11.0
Installing ri documentation for xcodeproj-1.11.0
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for cocoapods-1.7.5
Installing ri documentation for cocoapods-1.7.5
Done installing documentation for xcodeproj, fourflusher, ruby-macho, cocoapods after 9 seconds
4 gems installed
安裝新版本之后:
pod --version
1.7.5
再 pod update 或者 pod install 的時(shí)候就不再報(bào)錯啦蜒程。
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update