首先 安装ruby 参考。http://www.cnblogs.com/daguo/p/4097263.html 不过最后没有切换成淘宝链接。安装完ruby后 开始安装cocoa pods 参考http://www.jianshu.com/p/b64b4fd08d3c。 第一步运行sudo gem install cocoapods
返回如下错误
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
查了查资料说可能是没有安装openssl引起的。 于是输入 brew install openssl
返回
Updating Homebrew...
Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version
于是输入 brew install openssl --force
返回
Warning: openssl-1.0.2k already installed, it's just not linked.
说是没链接,尝试连接 输入brew link --overwrite openssl
返回:
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
这个可难办了,查了半天,一上午的时间 总算找到了解决办法:参考链接 https://github.com/dotnet/cli/issues/3964#issuecomment-236485454
最终输入
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
解决了问题。特此记录下。