簡體   English   中英

錯誤:安裝nokogiri時出錯:錯誤:無法構建gem本機擴展

[英]ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension

我最近重新安裝了rbenv,因為它可以解決其他問題。 現在,我收到一個特定項目的全新雜志。

與已經發布的問題類似: nokogiri-錯誤:無法構建gem native擴展nokogiri無法安裝-錯誤:無法構建gem native擴展我嘗試了幾種解決方案,但沒有運氣。

這是我的壓縮錯誤:

|11:11:05| ~ bundle install
Fetching source index from https://rubygems.org/
Using rake 10.3.2
Using Ascii85 1.0.2
Using i18n 0.6.9
...
Using callsite 0.0.11
Using cancan 1.6.10
Using mini_portile 0.5.2


Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

    bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.

Password:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.2.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... OK
Running 'install' for libxml2 2.8.0... OK
Activating libxml2 2.8.0 (from /private/var/folders/mp/tl8cpc_j0vd504t3npnqxzl00000gn/T/bundler20140627-949-55sx95/nokogiri-1.6.1/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.2.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin13.2.0/ports/libxslt/1.1.26... OK
Running 'configure' for libxslt 1.1.26... OK
Running 'compile' for libxslt 1.1.26... OK
Running 'install' for libxslt 1.1.26... OK
Activating libxslt 1.1.26 (from /private/var/folders/mp/tl8cpc_j0vd504t3npnqxzl00000gn/T/bundler20140627-949-55sx95/nokogiri-1.6.1/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.2.0/libxslt/1.1.26)...
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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
...
    --without-iconvlib
    --with-xml2lib
    --without-xml2lib

extconf failed, exit code 1

Gem files will remain installed in /var/folders/mp/tl8cpc_j0vd504t3npnqxzl00000gn/T/bundler20140627-949-55sx95/nokogiri-1.6.1/gems/nokogiri-1.6.1 for inspection.
Results logged to /var/folders/mp/tl8cpc_j0vd504t3npnqxzl00000gn/T/bundler20140627-949-55sx95/nokogiri-1.6.1/extensions/universal-darwin-13/2.0.0/nokogiri-1.6.1/gem_make.out
An error occurred while installing nokogiri (1.6.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.
|11:15:49| ~ sudo gem install nokogiri -v '1.6.1'
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.2.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... OK
Running 'install' for libxml2 2.8.0... OK
Activating libxml2 2.8.0 (from /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.2.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin13.2.0/ports/libxslt/1.1.26... OK
Running 'configure' for libxslt 1.1.26... OK
Running 'compile' for libxslt 1.1.26... OK
Running 'install' for libxslt 1.1.26... OK
Activating libxslt 1.1.26 (from /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.2.0/libxslt/1.1.26)...
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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-xml2lib
    --without-xml2lib

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/nokogiri-1.6.1/gem_make.out

我完整的錯誤消息在這里: http : //pastebin.com/4QmXL9e1

作為問題gem install nokogiri -v '1.5.9'中的一些答案, sudo port upgrade libxml2 libxslt

紅寶石

sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby

野吉里

sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri

這是我的紅寶石版本和其他系統信息的一些信息http://pastebin.com/fcWDTiq9

如果您使用的是centos,則安裝此程序:

yum install libxslt-devel libxml2-devel

為了我。 在基本OS 5中,juno可與...一起安裝ruby 1.8

sudo apt-get install ruby1.8

然后安裝nokogiri 1.8.5

sudo apt-get install nokogiri -v '1.8.5'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM