How to Install Rails on Mac (M1 and Intel), the Easy Way

Updated

With this updated guide for 2022, you’ll be able to install Rails 7 on your Mac in minutes.

Every day, many people get stuck trying to install Rails on macOS due to outdated, incomplete, and confusing instructions. Today, you’re about to save a lot of time and frustration.

Here are the two best ways to install Rails on a Mac:

Install Rails on Mac with an automated script that does everything for you

To install Rails on a Mac, you first need a proper Ruby development environment. Even though macOS come preinstalled with Ruby, it’s not recommended to use the version that came with your Mac, known as the system Ruby. To learn more, read why you shouldn’t use the system Ruby.

Setting up a proper Ruby development environment on a Mac involves several steps, which many people fumble when trying to follow long tutorials or videos. You might get confused about which shell you’re using, or why you’re getting a “Rails is not currently installed on this system” error even after successfully installing Rails.

To eliminate any chance of human error, I built Ruby on Mac, a reliable script that automates the whole process with a single command, and with a perfect result every time. It also automatically installs Rails and all the other development tools you’ll need.

Read what people say about the script.

If you value your time and want to save yourself a headache, you won’t regret using Ruby on Mac.

Install Rails on Mac manually with a Ruby version manager

While there are various ways to install and use Ruby on a Mac, there’s only one method I recommend: by installing a separate version of Ruby using a version manager. To learn more, read my definitive guide to installing Ruby gems on a Mac.

Over the past ten years, I’ve helped thousands of people set up Ruby on their Mac. From clean Macs to the most obscure issues, I’ve seen and fixed it all. And the most reliable solution is to use a version manager, specifically chruby.

If you haven’t yet tried to install Ruby or other development tools on your Mac, you should be able to get up and running with the basics by following my step-by-step guide for installing Ruby on a Mac.

This is the manual equivalent of the “Basic” version of Ruby on Mac, minus the comprehensive troubleshooting guide. You’ll then need to manually install the Rails gem, and all the other necessary tools for Rails.

If you’ve already tried to set things up and you’re running into issues you can’t figure out, you can still try my step-by-step guide, but Ruby on Mac will get you unstuck much faster.

Further reading

Once you have your Rails app up and running, I recommend reading about the first gem you should add to your Rails app.