Skip to content

Instantly share code, notes, and snippets.

@lrjbrual
Forked from sixfeetover/notes.md
Created May 6, 2017 19:27
Show Gist options
  • Save lrjbrual/c19829b6eb2bc286ecfb1790eb0c5ef5 to your computer and use it in GitHub Desktop.
Save lrjbrual/c19829b6eb2bc286ecfb1790eb0c5ef5 to your computer and use it in GitHub Desktop.
MacOS Sierra upgrade for Rubyists

Upgrading to Sierra for Ruby Devs

Often when upgrading to the latest OS X MacOS you have to do a few things to account for changing to underlying libraries. Here are the post-upgrade steps I took to get back to a fully operational state. I use homebrew and rbenv to manage my environment.

1. Get your Developer Command line tools upgraded.

To do this just run

$ xcode-select --install

and confirm the system pop up.

2. Ensure homebrew is up to date.

$ brew up

3. Upgrade any relevant old homebrew managed libraries you have.

$ brew upgrade [package1, package2, ...]

4. Reinstall ruby

I almost always need to do this for major OS upgrades. This time it was readline that changed, and threw this message:

Sorry, you can't use byebug without Readline. To solve this, you need to
rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
install libreadline-dev` and then reinstall your Ruby.

This is simple with rbenv and ruby-build:

$ rbenv install 2.3.1 --force

5. Make your gems pristine

With ruby reinstalled, ruby itself is working, but many of the gems with native extensions need to be recompiled. You get messages like this when trying bundle install:

Ignoring scout_apm-3.0.0.pre3 because its extensions are not built.  Try: gem pristine scout_apm --version 3.0.0.pre3

I had enough of these that I decided to just make all my gems pristine:

$ gem pristine --all

This takes a long time. You can of course just do gem pristine gem1 gem2 gem3... if you know the list.

6. All done! Get back to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment