安装ruby,安装cocoapods

首先使用homebrew安装ruby:

$ brew install ruby

设置环境并应用

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/xxx/.bash_profile
$ echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
$ echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile

$ source ~/.bash_profile

检查环境

$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
$ which ruby
/usr/local/opt/ruby/bin/ruby

安装cocoapods

$ sudo gem install -n /usr/local/bin cocoapods

你可能感兴趣的:(安装ruby,安装cocoapods)