I help maintain a Ruby 1.9.3-p551 based Rails 2.3.18 project. Recently I upgraded to
OS X High Sierra and shortly thereafter had to rebuild the gemset. Unfortunately
bundle install failed with the following compile errors:
/usr/include/AvailabilityInternal.h:27982:74:
error: missing binary operator before token "("
#if defined(__has_feature) && defined(__has_attribute) && __has_attribute(availability)
^
/usr/include/Availability.h:391:74:
error: missing binary operator before token "("
#if defined(__has_feature) && defined(__has_attribute) && __has_attribute(availability)
^
- Specify the version of nokogiri to be installed to be at least 1.6.0 or higher
- brew install llvm to retrieve it.
- Build the nokogiri gem while supplying the path to the desired compiler:
CC=/usr/local/opt/llvm/bin/clang bundle update nokogiri
This time, bundle install should "get past" this error.