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
andrvm 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*
andlibxml2*
libs from~/.rvm/usr/lib
if you had previously donervm 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 thenokogiri
folder. - Apply patch:
patch -p1 < x86_64.patch
- Rebuild:
rake native gem
— this should build the gem in thepkg/
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
Do You Know an Alternative Ctags Generator for Ruby
Ruby/Ror: Calling Original Method via Super()
Testing a Concern/Module That Uses Activerecord
Multiple Blogs in Single Jekyll Website
What's the Fastest Way to Check If a Word from One String Is in Another String
How to Assign Multiple Values to a Hash Key
Using Ruby and Net-Ssh, How to Authenticate Using the Key_Data Parameter with Net::Ssh.Start
Help Understanding Yield and Enumerators in Ruby
Ruby on Rails, Paperclip, Amazon Aws S3 & Heroku
What Does the Regular Expression [\W-] Mean
Pry Not Stopping When Called from a Ruby Script That Reads from Stdin
Why Is This Permissions Error Occurring with Mod_Passenger.So
Call Task More Than Once in Rails 3 Generator
Url_For of a Custom Restful Resource (Composite Key; Not Just Id)