问题
third day can't install nokogiri....Tried all instruction's from stack overflow and from official nokogiri page.Will be glad for any help,Thanx!!!!
ruby -v 2.1
rvm -v 1.25.18
OS X 10.9.1
Xcode 5.0.2
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix
brew list
apple-gcc42 grep libksba libxslt pcre sqlite
autoconf libgpg-error libtool libyaml pkg-config wget
automake libiconv libxml2 openssl readline xz
Error in terminal
gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/bp/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.0.0/ports/libxml2/2.8.0... *** 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
--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=/Users/bp/.rvm/rubies/ruby-2.1.0/bin/ruby
/Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:211:in `split': invalid byte sequence in UTF-8 (ArgumentError)
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:211:in `which'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:198:in `block in tar_exe'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:197:in `each'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:197:in `find'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:197:in `tar_exe'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:242:in `extract_file'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:34:in `block in extract'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:32:in `each'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:32:in `extract'
from /Users/bp/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:106:in `cook'
from extconf.rb:101:in `block in <main>'
from extconf.rb:119:in `call'
from extconf.rb:119:in `block in <main>'
from extconf.rb:109:in `tap'
from extconf.rb:109:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/bp/.rvm/gems/ruby-2.1.0@ideaprint_rails_4/gems/nokogiri-1.6.1 for inspection.
Results logged to /Users/bp/.rvm/gems/ruby-2.1.0@ideaprint_rails_4/extensions/x86_64-darwin-13/2.1.0/nokogiri-1.6.1/gem_make.out
回答1:
This should solve your problem:
xcode-select --install
Btw, you need to have xcode installed first.
source: https://stackoverflow.com/a/19570890/702560
来源:https://stackoverflow.com/questions/21887068/cannt-install-nokogiri-1-6-1-on-mac-os-x-10-9-maveriks