How to install Nokogiri on Mac OS Sierra 10.12

后端 未结 8 1730
孤街浪徒
孤街浪徒 2021-01-29 22:38

I\'m having troubles installing Nokogiri (1.6.8.1) on Mac OS Sierra 10.12.

I tried using brew install libxml2 libxslt and then referencing the install direc

相关标签:
8条回答
  • 2021-01-29 23:05

    If you have earlier installed nokogiri using bundler with bundle config build.nokogiri --use-system-libraries this setting will still be there. If you then meanwhile have solved your Xcode setup (as suggested as the primary method of installation in the nokogiri installation) then you might wanna try removing that fra from bundler bundle config --delete build.nokogiri and try again doing bundle install.

    0 讨论(0)
  • 2021-01-29 23:13

    Open Xcode and, from the menu XCode -> Preferences update your Command Line Tools (Xcode 8.0).

    Then do:

    bundle config build.nokogiri --use-system-libraries=true --with-xml2-include="$(xcrun --show-sdk-path)"/usr/include/libxml2
    bundle install
    

    or just:

    gem install nokogiri -v 1.6.8.1 -- --use-system-libraries=true --with-xml2-include="$(xcrun --show-sdk-path)"/usr/include/libxml2
    
    0 讨论(0)
提交回复
热议问题