我最近更新到 ruby v 2.6 升级后,我在安装 pod 时遇到问题,并出现以下错误
Traceback (most recent call last):
7: from /usr/local/bin/pod:23:in `<main>'
6: from /usr/local/bin/pod:23:in `load'
5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- xcodeproj (LoadError)
8: from /usr/local/bin/pod:23:in `<main>'
7: from /usr/local/bin/pod:23:in `load'
6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- xcodeproj (LoadError)
我已经尝试过
sudo gem install cocoapods
但没有帮助。
有人遇到类似问题并找到解决方案吗?
只有这个对我有用:
sudo gem install cocoapods --user-install
sudo gem install cocoapods && pod install
安装 RVM