欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos yum install nokogiri 1.5.8 不成功的解决方案

程序员文章站 2022-07-12 21:26:36
...

centos下安装nokogiri不成功,提示如下:

gem install nokogiri -v 1.5.8

Building native extensions.  This could take a while...

ERROR:  Error installing nokogiri:

        ERROR: Failed to build gem native extension.

 

    /usr/local/rvm/rubies/ruby-1.9.3-p545/bin/ruby extconf.rb

checking for libxml/parser.h... 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.

 

 

解决方案:

 

yum -y install gcc gcc-c++ zlib-devel openssl-devel readline-devel libxml2 libxml2-devel libxslt libxslt-devel

 

是因为缺少编译环境,解决了:

 

gem install nokogiri -v 1.5.8

Building native extensions.  This could take a while...

Successfully installed nokogiri-1.5.8

Installing ri documentation for nokogiri-1.5.8

 

1 gem installed