Ubuntu Lucid "gem install nokogiri" problems (with RVM and Ruby 1.9)
Just ran into an issue running “gem install nokogiri” when using RVM on Ubuntu Lucid for Ruby 1.9.
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/bin/ruby1.8 extconf.rb extconf.rb:5:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:5
Turns out that for some reason, you need to have ruby1.8-dev installed first. I’d been ignoring that bit, since I was running 1.9.2. It doesn’t matter that you’re using 1.9.x, you still need it.
sudo apt-get install ruby1.8-dev
This advice is already all over the internet, but I was ignoring that line. There are a few other things you can run if that doesn’t work, but they’re all easy to find via google.