美文网首页
2018最新 pod install 出错

2018最新 pod install 出错

作者: Bitter龙 | 来源:发表于2018-03-01 13:35 被阅读0次

    之前因为安装nginx 把我的pod版本给覆盖了,导致pod版本出错。查阅了很多文章才找出来。

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/Homebrew/global.rb:3:in `'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'from /usr/local/Library/brew.rb:16:in `'

    :首先确认下Ruby的版本
    MAC自带的Ruby版本一般比较低(记得是2.0.0,查看版本ruby -v),先升级一下,
    1.没有安装homebrew的话先安装一下
    ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    2.通过brew安装Ruby最新版本
    brew update(最新的话直接跳过)
    brew install ruby
    三、重新安装一下cocoapods

    不要使用sudo gem install cocoapods,这样的话可能会有一些问题 , 现在解决一下现在的问题 。

    1. Uninstall Cocoapods:

    sudogem uninstall cocoapods

    2.Install cocoapods without sudo:

    gem install cocoapods -V--no-ri --no-rdoc

    3.Set up Cocoapods:

    pod setup
    大功告成!!!!!

    相关文章

      网友评论

          本文标题:2018最新 pod install 出错

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