美文网首页
使用Cocoapods 发现ruby版本报错

使用Cocoapods 发现ruby版本报错

作者: LoveToday2020 | 来源:发表于2022-08-24 21:31 被阅读0次

错误例子

Traceback (most recent call last):
    4: from /Users/xmly/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `<main>'
    3: from /Users/xmly/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `eval'
    2: from /Users/xmly/.rvm/gems/ruby-2.7.5/bin/pod:23:in `<main>'
    1: from /Users/xmly/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/xmly/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)

解决方案
我是将其切换到ruby版本是2.7.0 解决这个问题

1.查看可以安装的ruby版本

rvm list known

2.安装想要的ruby版本

rvm install <version>

3.切换ruby设置为默认版本

rvm use ruby-2.5.1 --default

二、如果碰到错误

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

解决方法:

gem install cocoapods --user-install 1.11.3

相关文章

网友评论

      本文标题:使用Cocoapods 发现ruby版本报错

      本文链接:https://www.haomeiwen.com/subject/smwogrtx.html