Closed mahinthjoe closed 9 years ago
sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri -- --use-system-libraries -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include
before that you must 1、 Download and install Apple Commandline Tools for 10.10
2、 brew tap homebrew/dupes brew install libxml2 libxslt brew install libiconv
Done Successfully, Thanks
Hello!
This is not the right github project to ask for help on Nokogiri. The appropriate place is https://github.com/sparklemotion/nokogiri
Additionally, you will likely receive more prompt support, and possibly better support, by emailing the nokogiri-talk mailing list. Please see http://www.nokogiri.org/tutorials/getting_help.html for details
$ sudo gem install nokogiri Password: Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.
checking if the C compiler accepts ... yes checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no Building nokogiri using packaged libraries. Ignoring ffi-1.9.6 because its extensions are not built. Try: gem pristine ffi --version 1.9.6 Ignoring json-1.8.2 because its extensions are not built. Try: gem pristine json --version 1.8.2 checking for gzdopen() in -lz... yes checking for iconv... yes
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.2 with the following patches applied:
Team Nokogiri will keep on doing their best to provide security updates in a timely manner, but if this is a concern for you and want to use the system library instead; abort this installation process and reinstall nokogiri as follows:
If you are using Bundler, tell it to use the option:
Note, however, that nokogiri is not fully compatible with arbitrary versions of libxml2 provided by OS/package vendors.
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2... OK Running patch with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch... Running 'patch' for libxml2 2.9.2... OK Running patch with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch... Running 'patch' for libxml2 2.9.2... OK Running 'configure' for libxml2 2.9.2... OK Running 'compile' for libxml2 2.9.2... ERROR, review '/Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2/compile.log' to see what happened. * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby --help --clean --use-system-libraries --enable-static --disable-static --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --enable-cross-build --disable-cross-build /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in'
block in execute': Failed to complete compile task (RuntimeError) from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in
chdir' from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:inexecute' from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:70:in
compile' from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:110:incook' from extconf.rb:278:in
block in process_recipe' from extconf.rb:177:intap' from extconf.rb:177:in
process_recipe' from extconf.rb:475:in `extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.6.2/gem_make.out
Anything else required, I have tried all options for this help file