首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未安装Nokogiri依赖项libxml和libxslt

未安装Nokogiri依赖项libxml和libxslt
EN

Stack Overflow用户
提问于 2014-09-04 16:35:18
回答 1查看 3.4K关注 0票数 3

我在Ubuntu 12.10 64位上使用Ruby 2.1。我无法安装Nokogiri,因为它需要libXSLT和libxml。我试图安装这两个,但得到了这个错误:

代码语言:javascript
复制
***@***:~$ sudo apt-get install libxslt-dev libxml2-dev
[sudo] password for : 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
libxml2-dev is already the newest version.
The following NEW packages will be installed:
  libxslt1-dev
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 578 kB of archives.
After this operation, 2,422 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: **The following packages cannot be authenticated!**
  libxslt1-dev
Install these packages without verification [y/N]? y
Err http://security.ubuntu.com/ubuntu/ quantal-security/main libxslt1-dev amd64 1.1.26-14ubuntu0.1
  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxslt/libxslt1-dev_1.1.26-14ubuntu0.1_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing

我也尝试添加了12.04的安全更新,但仍然没有成功。

我运行了sudo apt-get update,但问题仍然存在。

当我运行bundle installgem install nokogiri时,我得到以下错误:

代码语言:javascript
复制
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

  /home/####/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt 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
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/home/kamal/.rvm/rubies/ruby-2.1.0/bin/ruby
  --with-zlib-dir
  --without-zlib-dir
  --with-zlib-include
  --without-zlib-include=${zlib-dir}/include
  --with-zlib-lib
  --without-zlib-lib=${zlib-dir}/lib
  --with-iconv-dir
  --without-iconv-dir
  --with-iconv-include
  --without-iconv-include=${iconv-dir}/include
  --with-iconv-lib
  --without-iconv-lib=${iconv-dir}/lib
  --with-xml2-dir
  --without-xml2-dir
  --with-xml2-include
  --without-xml2-include=${xml2-dir}/include
  --with-xml2-lib
  --without-xml2-lib=${xml2-dir}/lib
  --with-xslt-dir
  --without-xslt-dir
  --with-xslt-include
  --without-xslt-include=${xslt-dir}/include
  --with-xslt-lib
  --without-xslt-lib=${xslt-dir}/lib
  --with-libxslt-config
  --without-libxslt-config
  --with-pkg-config
  --without-pkg-config
  --with-libxml-2.0-config
  --without-libxml-2.0-config
  --with-libiconv-config
  --without-libiconv-config

extconf failed, exit code 1

Gem files will remain installed in /home/kamal/.rvm/gems/ruby-2.1.0@xxx/gems/nokogiri-1.5.11 for inspection.
Results logged to /home/****/.rvm/gems/ruby-2.1.0@project-trave/extensions/x86_64-linux/2.1.0/nokogiri-1.5.11/gem_make.out
An error occurred while installing nokogiri (1.5.11), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.11'` succeeds before bundling.
EN

回答 1

Stack Overflow用户

发布于 2014-09-04 16:56:51

试试这个:

代码语言:javascript
复制
sudo apt-get install libxslt-dev libxml2-dev zlib1g-dev
sudo gem install nokogiri

您需要在计算机上安装所有必需的库。当您安装RVM时,它应该已经为您列出了以下内容。在当前版本的rvm上,您可以运行rvm requirements查看确切的列表。我希望这能帮助你..

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25660839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档