ruby 安装和升级rubyUpdated: 2025-08-19ruby 安装和升级 🔗1 2 brew install ruby 由于macos本身自带了ruby但是版本比较低 这里我们不删除自带版本,重新安装一个新的1 vim .bash_profile 1 2 3 4 export PATH="/usr/local/opt/ruby/bin:$PATH" export LDFLAGS="-L/usr/local/opt/ruby/lib" export CPPFLAGS="-I/usr/local/opt/ruby/include" export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig" Tagsruby Like Save Share