Setting up Ruby on Rails Development Environment on Mojave 10.14.2


Previously, I posted My Ruby on Rails Development Environment on how I set up my development environment. This article is still mostly correct as far as my checklist goes, but some of the steps have changed with time. I’ve copied most of the content from that article to this one with the updated steps as well as updated some of the text.

Sometimes we have to configure a new development machine, whether it is for ourselves or a friend. We often find that there are some little pieces of our environment that we have forgotten about or have neglected to document. This is my documentation for a ready-to-work development environment for Ruby on Rails.

About Me

I have been working with Ruby on Rails for several years (since 2009) and have tried various other platforms; yet always circling back to Ruby on Rails. In my early days, I developed on Ubuntu as I did not have nor could I afford an Apple. I moved back to a Windows machine and used my host operating system for my main development environment. I kept an Ubuntu server within a Virtual Machine (Oracle VirtualBox) where I would SSH into the VM and run any tasks. I used a shared network folder via Samba to access my files. While my environment was very productive, it didn’t have the true native feel of a development environment. I got an Apple, where I now spend my days developing Ruby applications.

I also run and maintain several projects; one of which is Drifting Ruby. Some of the older apps that I use for different things around the house will need updating from time to time and might use an older version of Ruby with a different gem versions. So, having multiple Ruby versions and being able to switch them is very handy.

I’ve been an active panelist on Ruby Rogues for over a year now. I love getting to know other members of the community through the talks that we have.

I’ve been an active member on the Ruby on Rails Link Slack group and chatting with other members in the community. This is by far one of the largest active communities that I’ve found for Rails related stuff.

About This Guide

By no means are the topics or recommendations covered in this guide best practices. Please let me know if you have found anything that I should be doing differently. However, I have found that these steps work great for my productivity and comfort. Not everything in this guide is Ruby on Rails specific, but the majority does touch on the installation and configuration of Ruby on Rails or the development environment that I enjoy working in. This guide is based on MacOS Movaje 10.14.2. It should work for previous versions. If you do find some issues, please let me know and I”ll see about updating this guide.


I have found that there are a few programs that makes life much easier whenever I setup a new development environment. Here are the basic applications that I feel is necessary for any new environment.

Homebrew – The missing package manager for OSX
iTerm2 – Alternative Terminal
Spectacle – Hotkeys for Window Movement and Placement. This is an absolute must have if you’re using multiple monitors.
Visual Studio Code – Preferred text editor
Google Chrome – Browser of choice
EasyRes – Quick Resolution changer


Most developers that use an Apple probably rely on Homebrew as their quick goto for installing available packages. I’m no different. Let’s get Homebrew installed. For the rest of the guide, most of our work is done in the Terminal. Where necessary, I’ll indicate if you need to run something as sudo or not. If you do not see sudo prepended by any of the commands, it’s safe to say that it is not required and/or recommended.

We can then use Homebrew to install the rest of our software applications.



Visual Studio Code



While most Ruby on Rails developers like using PostgreSQL for their database backend, I like and use MySQL. You can also use MariaDB if you wish which is very similar to MySQL. I choose to install MySQL 5.7, otherwise version 8.x or later would get installed. I do this because I have older applications which are not directly compatible with v8.x+.

You can then start the MySQL service (and this will allow it to start whenever the computer is booted)

We then need to set our password for the mysql  server. Be sure to remember this password. We will set our password through the secure installation script that gets shipped with mysql .

You will be asked a series of questions. Other than the first question and setting the root password, I’ll answer yes to the rest.

Apache (Optional)

phpMyAdmin is a handy and fairly light weight web interface to the MySQL server. However, it does rely on enabling Apache as well as PHP

By default, Apache  comes with OSX 10.12.4 (as well as other previous versions). To start the service, type the below in your terminal.

PHP (Optional)

By default, the PHP module is included with OSX. However, it is not enabled. Edit the httpd.conffile.

Look for the following line (Use CTRL + W to do a search within nano) and uncomment the line (remove the pound infront of it). You kids may call it a hashtag, but I’m still oldschool.

Save the httpd.conf file. You can do this by typing CTRL + X within nano. It will prompt you to save, enter y and press enter (which will overwrite the existing file).


While MySQL Workbench is an absolutely great tool, I do not care for it. I prefer using PHPMyAdmin in my development environmen. I usually keep PHPMyAdmin opened in a different tab, but have recently found myself using it less and less.

Let’s create a symlink to the mysql.sock.

Install PHPMyAdmin

Let’s edit our httpd.conf again.

Another tool that I use very often is called puma-dev. This allows me to quickly access and spin up a Ruby on Rails application without having to manually start the web service. I have found that there is sometimes a conflict with the puma-dev service and apache. To avoid this entirely, I change the port that apache will listen on.

Look for the line Listen 80 and change this to:

At the very end of the httpd.conf file, copy and paste the code from the installation instructions

Restart apache

Oh My Zsh

If you prefer to have a fancier shell than bash, you can use oh-my-zsh. Purely a preference and an optional step. I will say though that the little x if changes that needs to be commited to version control and letting me know at a glance what branch I’m currently working on is a great tool to have if you spend a lot of time in the terminal.

You’ll then need to provide your user password to change your terminal to ZSH.


While OSX 10.14.2 does come with a Ruby interpreter, I do not like using my system ruby version. Instead, I use RVM as my Ruby Version Manager. Other ones like rbenv and chruby are fine. All three will act similar as far as keeping your ruby environments separate. At the time of this guide, Ruby 2.5.3 is the latest MRI version. This is the version that we will be using.

I often prefer to skip the installation of my gem documentation. I do this because it takes longer to download and install the gem. If I need to find the documentation of a gem, I’ll usually look at the Github README of the gem or similar.

Let’s install Ruby on Rails!

If you get an error trying to install the gem mysql2 then try the following command. You may want to add in your version number with a -v '0.5.2' after the gem name. Also, update the path to the MySQL directory based on your version.


Personally, since I use a privately hosted Gitlab environment for my version control, I install and configure git on my development machines. However, this is purely optional if you have your own way/method of version control.

Be sure to change your USERNAME and EMAILADDRESS to your own information.


In order to pull and push my code to my git repository, I authenticate my machine with the version control server via an authorized ssh key.

Copy and paste the SSH Key into your Version Control SSH Key section.


Puma-dev is an amazing tool. It will spin up web servers so that you can quickly access your Ruby on Rails applications. For example, if I have a project called testapp under ~/Rails/testapp, I can use puma-dev to create a link to this application. Even on a fresh reboot, I can go to or and it will launch my Ruby on Rails application. There is no need to go into your terminal to start the web service. You can also have multiple Ruby on Rails applications running at the same time with this. No more fuss with trying to find out which port is currently in use by another Ruby on Rails application.

For a video tutorial, check out

cd into your Rails application and ENTER. We will then create our link with puma-dev. You can pass the optional -n NAME to customize the that will be linked.

You now have a symlink created under ~/.puma-dev where it references to your Ruby on Rails application. You can now visit the in the browser and it should load up.

ElasticSearch (Optional)

If you use ElasticSearch for full text searching, then here is the quick way to install it. ElasticSearch does require Java to be installed.

Redis (Optional)

If you will be using cachingsidekiq, or ActionCable, you will need Redis.

ImageMagick (Optional)

If you upload images and resize them, you’ll most likely use minimagick. A dependency of these tools is ImageMagick.

With ActiveStorage and the upcoming ActionText, let’s also install vips to ready our system with this imaging tool. Janko, the creator of the Shrine gem, has done a lot of work on the image_processing gem which is used in the README for ActionText.

Pulling an Existing Project

I typically create a Rails folder in my home directory.

Cloning a repository from within my Rails folder, will create a new folder with that repository’s code.

From here, you’re ready to go with your new development environment!

Quick Notes of Advice

Within my Google Chrome Bookmarks Bar, I keep a few different things. My First thing is a folder in the bookmarks that keeps a shortcut to my puma-dev URLs. I also keep a bookmark to http://localhost:8888/phpmyadmin to quickly access PHPMyAdmin.

As newer versions of MacOS gets released, I’ll probably update this guide to those as well. If you haven’t checked out Drifting Ruby, be sure to do so as I cover a lot of exciting topics!

Follow me on Twitter @kobaltz and @driftingruby