Error installing Nokogiri on bundle install but already installed

不羁岁月 提交于 2019-11-28 03:57:16

Try running bundle config build.nokogiri --use-system-libraries as noted in the bundler output. Then re-run bundle.

Hiep Dinh
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install

it's work for me

(source here)

I had the same issues, but I solved it by installing nokogiri this way:

gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2

...then all was right with the world. I'll try:

bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2

...on my next rails app.

OS X 10.9.5

libxml2 2.9.2

Ruby 2.2.2

Rails 4.2.1

Nokogiri 1.6.6.2

On Mac OSX, you can execute below commands to fix this nokogiri gem issue.

xcode-select --install
gem install nokogiri
bundle install

I had the same issue, and I solved it with this:

sudo yum install patch
Dean Sims

I noticed that I hadn't installed tar on my system. After running dnf install tar, gem install nokogiri went fine.

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