无法在Mac OS X 10.9 Mavericks上安装nokogiri 1.6.1

时间:2014-02-19 16:53:58

标签: ruby nokogiri osx-mavericks

第三天无法安装nokogiri ....尝试从堆栈溢出和官方nokogiri页面的所有指令。将很高兴任何帮助,Thanx !!!!

  

ruby​​ -v 2.1

     

rvm -v 1.25.18

     

OS X 10.9.1

     
    

Xcode 5.0.2

  
     

配置: - prefix = / Library / Developer / CommandLineTools / usr --with-gxx-include-dir = / usr / include / c ++ / 4.2.1   Apple LLVM 5.0版(clang-500.2.79)(基于LLVM 3.3svn)   目标:x86_64-apple-darwin13.0.0   线程模型:posix

     
    

brew list

  
apple-gcc42 grep        libksba     libxslt     pcre        sqlite
autoconf    libgpg-error    libtool     libyaml     pkg-config  wget
automake    libiconv    libxml2     openssl     readline    xz
  
    

终端错误

  
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 个答案:

答案 0 :(得分:0)

这可以解决您的问题:

xcode-select --install
不过,您需要先安装xcode。

来源:https://stackoverflow.com/a/19570890/702560