For a more automated install you can use rbenv installer.
Update ruby mac homebrew.
Homebrew lets you avoid possible security problems associated with using the sudo command to install software like node.
Installing homebrew on a mac installation.
Hands off the system ruby.
The command is pretty straightforward.
It s all git and ruby underneath so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.
Ruby version manager or rvm for short as described on the rvm website is a command line tool which allows you to easily install manage and work with multiple ruby environments.
Homebrew is a commonly used package manager on macos.
The missing package manager for macos or linux.
How to install ruby on mac os x with rvm.
Brew install ruby.
Alright so now that homebrew is installed we can use it to install a newer version of ruby.
It s easier tons of build scripts break if their dependencies aren t in either usr or usr local we fix this for homebrew formulae although we don t always test for it but you ll find that many rubygems and python setup scripts break which is something outside our control.
This article explains why you should avoid using the version of ruby bundled with mac os x and should instead install your own version of ruby with rvm the ruby version manager.
Older versions of os x are mostly compatible so follow along as far as you can and then google search for any problems you run into.
If you prefer a manual approach follow the steps below.
Use the package manager to install ruby.
This should install the latest ruby version.
This will take about 30 minutes.
Installing ruby using homebrew is easy.
Homebrew macos ruby versions 2 0 and above are included by default in macos releases since at least el capitan 10 11.
Apple bundles the ruby programming language with os x.
With this homebrew will go out and fetch not only ruby but also any dependencies ruby needs to run.
It s easier usr local bin is already in your path.
To upgrade to the latest rbenv and update ruby build with newly released ruby versions upgrade the homebrew packages.
We will be setting up a ruby on rails development environment on macos 10 14 mojave.