問題一八匠、 zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
顯示找不到ruby蝶防,是shell地址改變了 變成了zsh。好嘛,重裝一下惫周。
1、重裝一下 ruby:brew install ruby?
Error: The following directories are not writable by your user:/usr/local/sbin
You should change the ownership of these directories to your user.
? ????????sudo chown -R $(whoami) /usr/local/sbin
And make sure that your user has write permission.
????????? chmod u+w /usr/local/sbin
執(zhí)行:sudo chown -R $(whoami) /usr/local/sbin
????????????chmod u+w /usr/local/sbin
2棚饵、檢查ruby?brew doctor
問題:Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
? ????????????echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
Warning: Broken symlinks were found. Remove them with `brew cleanup`: /usr/local/bin/code
執(zhí)行?echo export PATH="/usr/local/sbin:$PATH"
執(zhí)行?brew cleanup
3拍摇、 下載cocoapods:sudo gem install cocoapods
報錯:ERROR:? Could not find a valid gem 'cocoapods' (>= 0), here is why:
? ? ? ? ? Unable to download data from https://ruby.taobao.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (certificate rejected) (https://ruby.taobao.org/specs.4.8.gz)
因為之前是淘寶ruby,不維護了亮钦。
添加ruby-china:gem source -a https://gems.ruby-china.com
刪除:gem sources --remove https://ruby.taobao.org/
查看詳情:gem sources -l
4、下載:sudo gem install cocoapods
pod運行: pod setup
5充活、到指定路徑 執(zhí)行pod install
錯誤1:curl: (7) Failed to connect to 127.0.0.1 port 1080: Connection refused
錯誤2:curl: (7) Unable to receive initial SOCKS5 response.
我是因為添加了代理:export ALL_PROXY=socks5://127.0.0.1:1080
取消代理:unset ALL_PROXY
可以執(zhí)行命令查看代理?env|grep -I proxy
如果沒有 去vi ~/.zsh_profil 查看或者其他你寫入得地址蜂莉。
如果寫在了~/.zsh_profil,執(zhí)行命令:vi ~/.zsh_profil混卵,刪除代理
再執(zhí)行命令生效: source ~/.zsh_profil
6映穗、pod install 完成