Getting around an install problem only found in High Sierra

43 views
Skip to first unread message

Scott Smith

unread,
Nov 30, 2017, 9:29:58 AM11/30/17
to nokogiri-talk
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)
                                                                         
^


The problem is that the precompiler doesn't process the line correctlyAnother C compiler is needed.  Homebrew offers a modern LLVM compiler and so I tried that as follows:
  1. Specify the version of nokogiri to be installed to be at least 1.6.0 or higher
  2. brew install llvm to retrieve it.
  3. 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.

Reply all
Reply to author
Forward
0 new messages