nokogiri将不会安装-错误:构建gem原生扩展失败



在ubuntu 12.04系统上,我看到了下面的内容:

sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev
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.9 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.5.9/ext/nokogiri/gem_make.out

下面是myh版本的ruby

ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

我正在尝试安装使用knife-ec2 for chef.

您应该拥有必要的软件包:

Ruby

sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby

nokogiri

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

这应该解决这个问题。或者参见在Ubuntu 12.10上安装Nokogiri(1.5.2)的问题,它也应该能够回答你的问题。供将来参考的指针。尝试研究stackoverflow或其他可能有答案的资源,因为你可能会发现你的问题已经被解决了Wi

相关内容

  • 没有找到相关文章

最新更新