報錯信息
Traceback (most recent call last):
17: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/bin/ruby_executable_hooks:24:in `<main>'
16: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/bin/ruby_executable_hooks:24:in `eval'
15: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/bin/pod:25:in `<main>'
14: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/bin/pod:25:in `load'
13: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/gems/cocoapods-1.11.3/bin/pod:36:in `<top (required)>'
12: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
11: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
10: from /Users/john.lee/.rvm/gems/ruby-2.7.0-preview1/gems/cocoapods-1.11.3/lib/cocoapods.rb:9:in `<top (required)>'
9: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
8: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
7: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
6: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
5: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
4: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:11:in `<top (required)>'
3: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:17:in `<module:ActiveSupport>'
2: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:94:in `<module:XmlMini>'
1: from /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/core_ext/module/delegation.rb:244:in `delegate'
/Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/core_ext/module/delegation.rb:244:in `module_eval': /Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:94: syntax error, unexpected (..., expecting ')' (SyntaxError)
def parse(...); _ = backend; _.parse(......
^~~
/Users/john.lee/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:94: syntax error, unexpected ')'
....); _ = backend; _.parse(...);rescue NoMethodError => e; ...
...
問題原因:版本的問題庵佣,更換下版本服球。
我的解決步驟如下:
1.通過rvm list known查看下ruby的版本列表
2.再通過rvm use ruby-2.7.0 --default 設(shè)置某個為默認的版本
3.然后我執(zhí)行pod,發(fā)現(xiàn)又報錯了,報錯如下:
Traceback (most recent call last):
4: from /Users/john.lee/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/john.lee/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `eval'
2: from /usr/local/bin/pod:23:in `<main>'
1: from /Users/john.lee/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/Users/john.lee/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
-------------*********************----------
提示為gem不能找到cocopods,不能執(zhí)行
4. 執(zhí)行g(shù)em source 查找當(dāng)前源 我的是https://gems.ruby-china.com 沒有問題竖配,有多余的可以刪掉
5.執(zhí)行更新sudo gem update --system
6. 安裝cocopods sudo gem install -n /usr/local/bin cocoapods