问题描述
$ pod install
-bash: /usr/local/bin/pod:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby:
bad interpreter: No such file or directory
解决方案一
重新升级安装Cocoapods。参考:https://guides.cocoapods.org/using/getting-started.html#getting-started
$ [sudo] gem install cocoapods
··· 省略 ···
$ pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/Cellar in PATH, mode 040777
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 16 dependencies from the Podfile and 17 total pods installed.
解决方案二
如果是使用HomeBrew的方式安装CocoaPods,则可以按照以下顺序操作。参考:iOS-解决MacPod报错 -bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/...
- 执行如下命令
$ brew link --overwrite cocoapods
- 尝试Pod命令是否已经恢复,若报错则继续执行如下命令
$ brew reinstall cocoapods
$ brew install ruby
$ brew link --overwrite cocoapods
- 尝试Pod命令是否已经恢复
网友评论