1

当我sudo gem install nokogiri在 Ubuntu 12.1 上运行时,我得到了这个。出了什么问题,我该如何解决?

jason@jason:~/ror/clss$ sudo gem install nokogiri
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file 
-- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:5:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.5.5 for 
inspection. Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.5.5/ext/nokogiri
/gem_make.out
4

1 回答 1

3

尝试安装“libxslt-dev”和“libxml2-dev”包:

sudo apt-get install libxslt-dev libxml2-dev

说明在http://nokogiri.org/tutorials/installing_nokogiri.html


更新:

你需要sudo aptitude install ruby1.9.1-dev.

资料来源:“ Rails 教程:捆绑安装时的 nokogiri-1.5.2 错误”。

于 2012-11-21T07:26:01.847 回答