Force bundler to rebuild your Ruby on Rails project gemset

I got myself into a bad place after migrating a Rails project to a newer version of Ruby where my gemset was built with the wrong native libraries (rbenv rehash?).

Resulting error when running rspec:

dyld: lazy symbol binding failed: Symbol not found: _rb_funcall2

I had to delete and rebuild my gems but bundler itself doesn’t offer a pristine option.

The easiest way I found was to temporarily remove all gems from my Gemfile so that my Gemfile looked like.

source 'https://rubygems.org'

ruby '2.1.2'

Then:

bundle clean –force

Then undo and re-save my complete Gemfile and:

bundle install

Good to go.

This entry was posted in software development and tagged , , , by Ken Judy. Bookmark the permalink.

About Ken Judy

I am an executive leader, software developer, father and husband trying to do more good than harm. I am an agile practitioner. I say this fully aware I say nothing. Sold as a tool to solve problems, agile is more a set of principles that encourage us to confront problems. Broad adoption of the jargon has not resulted in wide embrace of these principles. I strive to create material and human good by respecting co-workers, telling truth to employers, improving my skills, and caring for the people affected by the software I help build.