Install Ruby (macOS)
Last updated 2026-10-07
Install Ruby on macOS with a version manager. macOS ships a system Ruby, but it is outdated and owned by the OS. Installing gems into it needs sudo and can break system tools, as noted in the fastlane iOS setup guide.
- 1
- 2
Install rbenv and Ruby 3.4.1
my-app — zsh~/my-app $ brew install rbenv ruby-build~/my-app $ rbenv init# Follow the printed instruction (adds rbenv to ~/.zshrc), then open a new terminal~/my-app $ rbenv install 3.4.1==> Installed ruby-3.4.1 to /Users/you/.rbenv/versions/3.4.1~/my-app $ rbenv local 3.4.1# writes .ruby-version in the project root - 3
Install Bundler
my-app — zsh~/my-app $ gem install bundlerSuccessfully installed bundler-2.6.2 - 4
Verify
my-app — zsh~/my-app $ which ruby/Users/you/.rbenv/shims/ruby~/my-app $ ruby --versionruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]~/my-app $ bundle --versionBundler version 2.6.2which ruby must point to ~/.rbenv/shims, not /usr/bin/ruby.
Caution: don't use the macOS system Ruby (
/usr/bin/ruby) and never run sudo gem install.Next steps
Official documentation
Was this helpful?