Home

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:

/usr/local/bin/brew:
/usr/local/Library/brew.rb:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby:
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

Issues

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.

Postgres

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

React May Not Be the Best Tool for Your Project

React is a great tool with a massive developer community. It comes with its own benefits and challenges. And yet, there may be tooling that is more suitable to your project.

Apr 19, 2023

Order Rails Query by Virtual Attribute

Rails' scopes don't work well with virtual attributes since they resolve to a SQL query. Instead you can throw them in an array and then sort by a virtual attribute.

Oct 22, 2014

Why I started blogging again

After a two-year break from blogging, I'm back at it. Here's what led to the pause, why I'm writing again, and seven benefits that come from regular writing.

Apr 12, 2025