Unable to install Nokogiri

ε祈祈猫儿з 提交于 2020-01-05 08:11:45

问题


When I run sudo gem install nokogiri on Ubuntu 12.1, I'm returned with this. What's wrong and how do I fix it?

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

回答1:


Try to install the "libxslt-dev" and "libxml2-dev" packages:

sudo apt-get install libxslt-dev libxml2-dev

The instructions are on http://nokogiri.org/tutorials/installing_nokogiri.html


Update:

You need sudo aptitude install ruby1.9.1-dev.

Source: "Rails Tutorial: nokogiri-1.5.2 error on bundle install".



来源:https://stackoverflow.com/questions/13488129/unable-to-install-nokogiri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!