macOS更新,CocoaPods问题 /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framewor...

万恶的os更新导致。。。。

问题记录:

1. /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

2.ERROR:  While executing gem ... (Gem::Exception)

    Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

3.ERROR:  While executing gem ... (Gem::Exception) 下其他问题

4.一切os更新万恶问题都解决在于重装ruby环境,gem更新,gem源  ,处理逻辑==先更新gem再重装Cocoapods,不行就重装ruby环境

==解决方法:(看自己需要而定)

查看当地ruby版本:$ ruby -v

卸载当前ruby版本或者重装 $ rvm uninstall 2.3.8  reinstall 2.3.8

安装新版ruby $ rvm install 2.6.3 --disable-binary

指定ruby版本 $ rvm use ruby -2.6.3

验证ruby版本 $ ruby -v

安装CocoaPods $ sudo gem install cocoapods

建立本地仓库 $ pod setup (看自己需要)

工程项目pods $ pod install --repo-update

可能遇到问题:[!] CDN: trunk Repo update failed - 6 error(s):

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.0.1/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

解决:Podfile 添加 source 'https://github.com/CocoaPods/Specs.git'

后面是操作一堆命令,花里胡哨记录一下

Last login: Thu Mar  5 12:00:21 on ttys000

xuanmeijian@xunxunxun ~ % $pod setup

zsh: command not found: setup

xuanmeijian@xunxunxun ~ % 

xuanmeijian@xunxunxun ~ % pod setup

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

xuanmeijian@xunxunxun ~ % 

xuanmeijian@xunxunxun ~ % 

xuanmeijian@xunxunxun ~ % pod setup

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

xuanmeijian@xunxunxun ~ % 

xuanmeijian@xunxunxun ~ % sudo gem install -n /usr/local/bin CocoaPods

Password:

ERROR:  While executing gem ... (Gem::Exception)

    Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

xuanmeijian@xunxunxun ~ % ruby -v

ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin19]

xuanmeijian@xunxunxun ~ % gem use 2.6.3

ERROR:  While executing gem ... (Gem::CommandLineError)

    Unknown command use

xuanmeijian@xunxunxun ~ % remove 2.3.8

zsh: command not found: remove

xuanmeijian@xunxunxun ~ % gem remove 2.3.8

ERROR:  While executing gem ... (Gem::CommandLineError)

    Unknown command remove

xuanmeijian@xunxunxun ~ % cd /Users/xuanmeijian/Desktop/PodSuccees 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % pod install

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % pods install

zsh: command not found: pods

xuanmeijian@xunxunxun PodSuccees % pod -v

zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory

xuanmeijian@xunxunxun PodSuccees % rvm uninstall 2.3.8

ruby-2.3.8 - #already gone

xuanmeijian@xunxunxun PodSuccees % rvm install 2.6.3 --disable-binary 

Already installed ruby-2.6.3.

To reinstall use:

    rvm reinstall ruby-2.6.3

xuanmeijian@xunxunxun PodSuccees %  rvm use ruby -2.6.3

Unrecognized command line flag: '-2.6.3'

Run `rvm help` to see usage information

xuanmeijian@xunxunxun PodSuccees % rvm use ruby-2.6.3

Using /Users/xuanmeijian/.rvm/gems/ruby-2.6.3

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % ruby -v

ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % sudo gem install cocoapods

Password:

Successfully installed cocoapods-1.9.0

Parsing documentation for cocoapods-1.9.0

Done installing documentation for cocoapods after 1 seconds

1 gem installed

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % pod setup

Setup completed

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % pod -v

[!] Unknown command: `-v`

Did you mean: env?

Usage:

    $pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache        Manipulate the CocoaPods cache

    + deintegrate  Deintegrate CocoaPods from your project

    + env          Display pod environment

    + init          Generate a Podfile for the current directory

    + install      Install project dependencies according to versions from a

                    Podfile.lock

    + ipc          Inter-process communication

    + lib          Develop pods

    + list          List pods

    + outdated      Show outdated project dependencies

    + plugins      Show available CocoaPods plugins

    + repo          Manage spec-repositories

    + search        Search for pods

    + setup        Setup the CocoaPods environment

    + spec          Manage pod specs

    + trunk        Interact with the CocoaPods API (e.g. publishing new specs)

    + try          Try a Pod!

    + update        Update outdated project dependencies and create new Podfile.lock

Options:

    --silent        Show nothing

    --version      Show the version of the tool

    --verbose      Show more debugging information

    --no-ansi      Show output without ANSI codes

    --help          Show help banner of specified command

xuanmeijian@xunxunxun PodSuccees % pod search AFNetworking

Creating search index for spec repo 'cocoapods'.. Done!

[!] CDN: trunk Repo update failed - 6 error(s):

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.0.1/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.1.1/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.1.2/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.1.4/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.1.6/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/e/1/AFNetworking-RACExtensions/0.1.8/AFNetworking-RACExtensions.podspec.json Response: Timeout was reached

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % pod install

Analyzing dependencies

[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/5/5/c/IQKeyboardManagerSwift/6.5.5/IQKeyboardManagerSwift.podspec.json Response: Timeout was reached

xuanmeijian@xunxunxun PodSuccees % vim Podfile

xuanmeijian@xunxunxun PodSuccees % pod install

[!] Invalid `Podfile` file: syntax error, unexpected tCONSTANT, expecting end

pod 'IQKeyboardManagerSwift'

     ^~~~~~~~~~~~~~~~~~~~~~

/Users/xuanmeijian/Desktop/PodSuccees/Podfile:8: unterminated string meets end of file.

 #  from /Users/xuanmeijian/Desktop/PodSuccees/Podfile:7

 #  -------------------------------------------

 #  source 'https://github.com/CocoaPods/Specs.git

 >  pod 'IQKeyboardManagerSwift'

 #  end

 #  -------------------------------------------

xuanmeijian@xunxunxun PodSuccees % vim Podfile

xuanmeijian@xunxunxun PodSuccees % pod install

Analyzing dependencies

[!] Unable to find a specification for `IQKeyboardManagerSwift`

You have either:

 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.

 * mistyped the name or version.

 * not added the source repo that hosts the Podspec to your Podfile.

xuanmeijian@xunxunxun PodSuccees % pod install --repo-update

Updating local specs repositories

  $ /usr/bin/git -C /Users/xuanmeijian/.cocoapods/repos/cocoapods fetch origin

  --progress

  remote: Enumerating objects: 42633, done.       

  remote: Counting objects: 100% (42633/42633), done.       

  remote: Compressing objects: 100% (44/44), done.       

  remote: Total 261326 (delta 42601), reused 42588 (delta 42588), pack-reused 218693       

  Receiving objects: 100% (261326/261326), 29.88 MiB | 40.00 KiB/s, done.

  Resolving deltas: 100% (180941/180941), completed with 9231 local objects.

  From https://github.com/CocoaPods/Specs

     a633e4116b5..02f6ce6cb8e  master      -> origin/master

   * [new branch]              orta-patch-1 -> origin/orta-patch-1

  $ /usr/bin/git -C /Users/xuanmeijian/.cocoapods/repos/cocoapods rev-parse

  --abbrev-ref HEAD

  master

  $ /usr/bin/git -C /Users/xuanmeijian/.cocoapods/repos/cocoapods reset --hard

  origin/master

  Checking out files: 100% (397274/397274), done.

  HEAD is now at 02f6ce6cb8e [Add] AppLovinMediationByteDanceAdapter 2.8.0.1.0

Analyzing dependencies

Downloading dependencies

Installing IQKeyboardManagerSwift (6.5.5)

Generating Pods project

Integrating client project

[!] Please close any current Xcode sessions and use `PodSuccees.xcworkspace` for this project from now on.

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

xuanmeijian@xunxunxun PodSuccees % 

xuanmeijian@xunxunxun PodSuccees % 

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,937评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,503评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,712评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,668评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,677评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,601评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,975评论 3 396
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,637评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,881评论 1 298
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,621评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,710评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,387评论 4 319
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,971评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,947评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,189评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,805评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,449评论 2 342

推荐阅读更多精彩内容