What Is a Robust Installation Process for Nokogiri (On Ubuntu)

What is a robust installation process for Nokogiri (on Ubuntu)?

I have also experienced the same problem with rvm, even though I had done the following, as per documentation:

  • sudo apt-get install libxslt-dev libxml2-dev
  • rvm pkg libxml2 and rvm pkg libxslt

The only way I could get this solved was, after a lengthy investigation:

  • Uninstall the ruby installation: rvm remove 1.9.3
  • Delete all libxslt* and libxml2* libs from ~/.rvm/usr/lib if you had previously done rvm pkg ...
  • Reinstall ruby: rvm install 1.9.3

Reinstalling after the apt-get commands seems to be the only way of getting this to work. Also, ensuring the libs installed with rvm pkg don’t interfere helped.

When everything else fails...

If everything else fails and you absolutely need the gem installed, you can also rebuild nokogiri by applying a simple patch — provided that you have all build tools installed, and with the caveat that this will install the latest and potentially unstable code:

  • git clone git://github.com/sparklemotion/nokogiri
  • get patch from this gist and save it as x86_64.patch in the nokogiri folder.
  • Apply patch: patch -p1 < x86_64.patch
  • Rebuild: rake native gem — this should build the gem in the pkg/ folder
  • Install the gem using gem install pkg/nokogiri-<version>-x86_64-linux.gem

Nokogiri fails install on Ubuntu 20.04

I reinstalled Ubuntu 20.04 fresh along with Ruby etc, and it worked. I don't know what went wrong, and I don't know if any of the solutions below will work.

Rails fails to install on Sierra

try:

gem update --system

then:

xcode-select --install

then:

gem install nokogiri

and finally:

install the rails gem

Error installing rails because extconf.rb failed on Ubuntu 18.04

Here are the docs to install nokogiri https://nokogiri.org/tutorials/installing_nokogiri.html, there is a note for rvm:

Note for RVM users: you may require libgmp, consider running sudo
apt-get install libgmp-dev.

Remove ruby with rvm https://rvm.io/rubies/removing

rvm remove 2.6.0

Install

Ruby

rvm install 2.6.0

Rails

gem install rails

For a existing project

bundle install

Multiple errors while trying install ruby on rails through an ubuntu WSL terminal

You are missing a compiler, and probably a lot of other essential libraries and tools from your WSL setup. Hopefully this will cover most of what you need:

sudo apt-get install build-essential
sudo apt-get install libxml2-dev libsqlite3-dev zlib1g-dev liblzma-dev


Related Topics



Leave a reply



Submit