gpt4 book ai didi

ruby-on-rails - Nokogiri 依赖项 libxml 和 libxslt 未安装

转载 作者:数据小太阳 更新时间:2023-10-29 07:45:01 26 4
gpt4 key购买 nike

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

***@***:~$ 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 时,出现以下错误:

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.

最佳答案

试试这个:

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

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

关于ruby-on-rails - Nokogiri 依赖项 libxml 和 libxslt 未安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25660839/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com