Upgrading Homebrew for Mac OS X Yosemite

A new operating system means taking a few minutes to upgrade Homebrew. Here is how I went through the process.

You've installed Mac OS X Yosemite, and now it's time for that feared task -- upgrading Homebrew.

At first, brew wouldn't work at all. I saw this error:

bad interpreter: No such file or directory

This was fixed by changing 1.8 on the first line of /usr/local/Library/brew.rb to "Current." Found that trick here.

Next, I went to upgrade Homebrew.

$ brew upgrade


Bundler & OpenSSL

Then I ran into an error with Bundler and OpenSSL, since Apple has ditched OpenSSL for their own encryption library. My error from running bundle install was:

Symbol not found: _SSLv2_client_method (LoadError)

This was fixed by relinking gcc and reinstalling the version of Ruby I was using.

$ export CC=/usr/bin/gcc
$ rbenv install 2.1.0

rbenv: /Users/sean/.rbenv/versions/2.1.0 already exists
continue with installation? (y/N) y

RMagick, Nokogiri & Libiconv

When trying to run a Rails project, I started with this issue related to RMagick:

This installation of RMagick was configured with ImageMagick 6.8.8
but ImageMagick 6.8.9-8 is in use. (RuntimeError)

Removing the bundle and trying to reinstall, like so:

$ rm -rf .bundle
$ bundle install

Led to another error, this time from nokogiri:

Building nokogiri using packaged libraries.
libiconv is missing.
please visit http://nokogiri.org/tutorials/installing_nokogiri.html
for help with installing dependencies.

extconf failed, exit code 1

This was fixed using the following commands:

$ xcode-select --install
$ gem uninstall nokogiri
$ gem install nokogiri
$ rbenv rehash

Here are a few important notes regarding this issue:

  • I use rbenv for managing rubies, which may change your process.
  • You'll (likely) needed to have gone through the reinstallation of your Ruby.
  • You'll also probably have to uninstall and reinstall the bundle for every Ruby project using this version of Ruby.


I had installed postgres via Homebrew and the upgrade to Yosemite removed some directories. Follow this advice I was able to get postgres running again.

$ mkdir /usr/local/var/postgres/pg_tblspc
$ mkdir /usr/local/var/postgres/pg_twophase
$ mkdir /usr/local/var/postgres/pg_stat_tmp

It may start automatically after that. If not, you can run:

$ brew info postgres

And at the bottom, you'll see some instructions on how to proceed. Something like this:

To have launchd start postgresql at login:
    ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
Then to load postgresql now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Or, if you don't want/need launchctl, you can just run:
    postgres -D /usr/local/var/postgres

Feel free to let me know if you run into other quick fixes I should add to this article.

Let's Connect

Keep Reading

Add Search to ActsAsTaggableOn with PostgreSQL and Context

ActsAsTaggableOn is a great gem for working with tags in your application, but it can be a PITA when you want to be able to search for tags.

Jan 30, 2017

Remove HTML Extension And Trailing Slash In Nginx Config

When you have a static site, sometimes you want to get rid of the HTML extensions and those pesky trailing slashes. Here's how I've done it.

Jul 22, 2015

Dynamic Routing in Middleman

Take Middleman's dynamic pages feature, combine it with data modeling, and voila! We have dynamic routing in Middleman.

May 04, 2018