Can't Install Thrift Gem on Os X El Capitan

Can't install thrift gem on OS X El Capitan

I have a solution for you! Hopefully.

Had this same problem the other day.

The problem is in the clang compiler that El Capitan comes bundled with. I'm sure it screws up other issues but this is one point that I had a lot of issues with.

Try running the following command and let me know how it goes!

gem install thrift -- --with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\"

ERROR: Failed to build gem native extension on Mavericks

Also make sure that you've upgraded Xcode to re-install command line tools on Mavericks.
In terminal type:

xcode-select --install

Then follow the prompts.

Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)

There are similar questions:

  • `require': no such file to load -- mkmf (LoadError)
  • Failed to build gem native extension (mkmf (LoadError)) - Ubuntu 12.04

Usually, the solution is:

sudo apt-get install ruby-dev

Or, if that doesn't work, depending on your ruby version, run something like:

sudo apt-get install ruby1.9.1-dev

Should fix your problem.


Still not working? Try the following after installing ruby-dev:

sudo apt-get install make


Related Topics



Leave a reply



Submit