Ruby on rails Linux操作系统Ruby 1.8.7的Nokogiri安装错误

Ruby on rails Linux操作系统Ruby 1.8.7的Nokogiri安装错误,ruby-on-rails,nokogiri,authorize.net,whm,libxslt,Ruby On Rails,Nokogiri,Authorize.net,Whm,Libxslt,我正在Linux操作系统上使用Rails 3.2.1和ruby 1.8.7。 我正在尝试在WHM服务器上安装Nokogiri for Authorize net gem。我得到以下错误: gem install nokogiri -v '1.5.0' Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build g

我正在Linux操作系统上使用Rails 3.2.1和ruby 1.8.7。 我正在尝试在WHM服务器上安装Nokogiri for Authorize net gem。我得到以下错误:

gem install nokogiri -v '1.5.0'

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

        /usr/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.
Building native extensions.  This could take a while...
ERROR:  Error installing libxslt-ruby:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for ruby/io.h... no
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... no
checking for libiconv_open() in -llibiconv... no
checking for iconv_open() in -llibiconv... no
checking for iconv_open() in -lc... yes
checking for xmlXPtrNewRange() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for xsltApplyStylesheet() in -lxslt... no
checking for xsltApplyStylesheet() in -llibxslt... no
checking for xsltApplyStylesheet() in -lxslt... no
*** 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.
mkmf.log文件声明缺少libxslt

在尝试安装libxslt ruby时,出现以下错误:

gem install nokogiri -v '1.5.0'

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

        /usr/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.
Building native extensions.  This could take a while...
ERROR:  Error installing libxslt-ruby:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for ruby/io.h... no
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... no
checking for libiconv_open() in -llibiconv... no
checking for iconv_open() in -llibiconv... no
checking for iconv_open() in -lc... yes
checking for xmlXPtrNewRange() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for xsltApplyStylesheet() in -lxslt... no
checking for xsltApplyStylesheet() in -llibxslt... no
checking for xsltApplyStylesheet() in -lxslt... no
*** 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.
mkmf.log文件说明:

have_header: checking for ruby/io.h... -------------------- no

"gcc -E -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -I/usr/local/include    -O2 -g -m64 -mtune=generic -Wall -fno-strict-aliasing  -fPIC    conftest.c -o conftest.i"
conftest.c:1:21: error: ruby/io.h: No such file or directory
checked program was:
/* begin */
1: #include <ruby/io.h>
/* end */
have_头:检查ruby/io.h不
“gcc-E-I.-I/usr/lib/ruby/1.8/x86_64-linux-I.-I/usr/local/include-O2-g-m64-mtune=generic-Wall-fno严格别名-fPIC conftest.c-o conftest.I”
conftest.c:1:21:错误:ruby/io.h:没有这样的文件或目录
检查的程序是:
/*开始*/
1:#包括
/*结束*/
我在Windows机器上开发,但客户端的服务器是Linux。我尝试过谷歌搜索,但没有成功

任何帮助都将不胜感激

提前谢谢

我认为“libxslt缺失”并不意味着您必须安装gemlibxslt-ruby。它告诉您安装libxslt-dev

只需跟随并运行:


你有没有试过遵循这个指南?在ubuntuI部分中,我尝试了上面的代码,但是它说:
sudo apt get install libxslt dev libxml2 dev-bash:sudo:command not found
@user3445812那么您是否获得了root访问权限?WHM服务器的cpanel显示了这样一个通知:“警告!您是使用经销商或root密码登录的。”但我仍然得到了“sudo not found”消息。@user3445812您以root用户身份登录。所以你不需要sudo。但是,以root用户身份登录不是一个好主意。链接页面(在撰写本文时)并不建议使用sudo运行“gem install”。我也不推荐。