unable to install nokogiri in ubuntu 12.04

假装没事ソ 提交于 2019-12-03 10:34:30
Benjamin Tan Wei Hao

Try this:

# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
gem install nokogiri

For Ruby 1.9.3 and 2.0, libxslt-dev and libxml2-dev are required.

sudo apt-get install libxslt-dev libxml2-dev

this is what worked for me:

  1. install nokogiri's dependencies

    sudo apt-get install libxslt-dev libxml2-dev

  2. make sure nokogiri uses the system libraries

    export NOKOGIRI_USE_SYSTEM_LIBRARIES=1

  3. install nokogiri with the --verbose option, to get a better understanding of any problems

    gem install --verbose nokogiri

Since I stumbled upon this, here's what I did to resolve:

sudo apt-get install ruby1.9.1-dev
Hiccup

On 14.0.4, using RVM, you need:

sudo apt-get install -y libgmp-dev

Install ruby via rvm and then install below libs:

sudo apt-get install libxslt-dev libxml2-dev

now try to install gem without sudo:

gem install nokogiri

apt-get install libxslt-dev libxml2-dev -y && export NOKOGIRI_USE_SYSTEM_LIBRARIES=1 && gem install --verbose nokogiri

for Centos / Redhat, try this: sudo yum install libxslt-devel libxml2-devel

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