我无法加载cocoapods。无论我输入什么gem命令,我都会收到以下错误:
/Users/jeff//.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:315:in `to_specs':
Could not find 'encrypted_strings' (>= 0) among 18 total gem(s) (Gem::LoadError)
Checked in
'GEM_PATH=/Users/jeff/.gem/ruby/2.1.0:/Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/gems/2.1.0', execute `gem env` for more information
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:58:in `gem'
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:65:in `<module:Kernel>'
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:7:in `<top (required)>'
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:1235:in `require'
from /Users/jeff/.rvm/rubies/ruby-
2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:1235:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
当我输入以下任何内容时,我收到此错误:
sudo gem install cocoapods
gem uninstall cocoapods
gem env
sudo gem install encrypted_strings
我的mac正在运行版本10.12.6 osx
我的/库中有Ruby。子目录包含Gems / 2.0.0。
请注意,前段时间,我正在开发另一个项目,让我将Ruby更新为版本ruby-2.1.5和ruby-2.1.5-dev。这些可以在“/Users/jeff/.rvm/rubies”中找到。现在,如果我转到“/ Library / Ruby / Gems”,则会有一个名为2.0.0的子目录。这里有不兼容性吗?
如何更正此问题?我应该以某种方式删除这些版本。如果是这样,怎么样?
答案 0 :(得分:1)
可能cocoapods
版本在不受支持的版本ruby中运行并再次安装。要解决此问题,请删除所有版本的cocoapods。怎么做才能找到答案https://superuser.com/a/686319
更新到新的macOS版本后可能会发生这种情况。 为防止以后使用rbenv Ruby environment
rbenv
允许不使用 root 访问