I recently updated to MacOS Sierra, aka 10.12, and got to relearn my dev environment when I wanted to do a little work in Ruby and ran face first into

> irb
Bond Error: Completion file '/usr/local/var/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/bond-0.5.1/lib/bond/completion.rb' failed to load with:
dlopen(/usr/local/var/rbenv/versions/2.2.5/lib/ruby/2.2.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/var/rbenv/versions/2.2.5/lib/ruby/2.2.0/x86_64-darwin15/readline.bundle	

How rude! It took me a couple of minutes to even remember that I’d updated to Sierra (it’s been a week; I’ve slept since then). Once that synapse fired, I knew it meant that all the versions of Ruby I’d installed with rbenv were built against the older readline, so it was time to rebuild and reinstall them all, as well as all of their gems with native extensions. Ugh.

Luckily, that’s not so horribly hard once you sort things out, so here’s the short course on how to deal with this:

> xcode-select --install
[... popup dialog launches and you do the install dance ...]
> brew update && brew upgrade
[... many package defs update and upgrade ... ]
> rbenv versions
* 2.3.1 (set by /usr/local/var/rbenv/version)
> rbenv install -f 2.3.1 && RBENV_VERSION=2.3.1 gem pristine --all
[... much building of ruby and gem native extensions ...]

From there, it’s repeat for every version of Ruby that you care about. It’s also a good time to remove any you don’t need anymore.

If this was useful, an upvote on my StackOverflow answer for this would be a kindness.

blog comments powered by Disqus


23 November 2016


hacking macos x ruby/rails